[foreach:regex]
[r_hello]
[/foreach]
Trying to match the above: regex (word between : and ]) will be $1 and anything between [foreach:regex] and [/foreach] will be $2.
So far I have this: /\[foreach:(.*)\](.*)\[\/foreach\]/s
But I’m getting this error: Notice: Undefined index: regex] [r_hello
Try:
http://phpfiddle.org/main/code/7av-ypa
The problems were: