I am trying to pluck out text found within the outermost brackets %[ and ] (the first bracket preceded by a % sign). I want to be able to next %[...] within each other, if necessary. I thought that the following would do the job, but alas my regex shortcomings have been exposed.
Any idea what I am doing wrong?
Thanks - Jim
Code:
if (preg_match("/^(^%\[)*%\[(.+)\](^\])*$/",$line,$matches)) { ... }
Any idea what I am doing wrong?
Thanks - Jim