I have this string: 1[2[5,6]],4,7[8,10] It represents nested IDs to be used to build an array of navigation items.
I need to parse this string and create a multidimensional array of its values. This will probably take several consecutive expressions and loops to build.
The end product would be an array like this:
1 =>
2 =>
5
6
4
7 =>
8
10
I think all I need is an expression that will split the string on commas not inside of a set of brackets. I would then loop over the substrings with the same pattern.