I am trying to write (I think) a fairly simple RegEx with PHP, but it does not work. Basically, I have a block defined as follows:
%%%%blockname%%%%
stuff goes here
%%%%/blockname%%%%
I do not use RegEx, but this is what I tried:
preg_match_all('/^%%%%(.*?)%%%%(.*?)%%%%\/(.*?)%%%%$/i',$input,$matches);
It returns an array with 4 empty elements.
I believe that, in addition to the work itself, you need some kind of pointer for the third match, because it should be equal to the first?
Please enlighten me :)
source
share