The source of the string is, well... Complicated, but let's just say it's a a string being passed through a function to make it easy. And no there's no way to pass it as anything else, sadly.
Weedpacket: Yes, regular expressions are faster than explode in this case, namely because it would require several explodes and the string length varies... It could be 3 characters with no need to split it, or it could be 200 characters long with 50 []'s.
Anyways, the problem I'm having right now is that the regex only shows the last match for the second porton of the string, no matter what I use... Preg_match, preg_match_all, ereg, etc.
cat[goes][meow]
0: Array
(
[0] => Array
(
[0] => cat[goes][meow]
[1] => cat
[2] => [meow]
[3] => meow
)
)
Whereas expresso matches (Or at least shows) all:
cat[goes][meow]
1) cat
2): [meow]
->[goes]
->[meow]
3): meow
->goes
->meow
Latest expression I've gotten: ([a-zA-Z0-9]+)([([a-zA-Z0-9]+)])*
Is there any way to either fix the expression so each result is laid out in an accessible way, or make PHP go deeper into the results?