Finding an open and closing tag in Regexp
- by Rixius
Is there a way to find custom tags in regexp I.e. match
{a}sometext{/a}
As well as
{c=#fff}sometext{/c}
So that it finds the entire block of inner content? The problem is the sometext could have another tag as in:
{a=http://www.google.com}{b}Hello, world{/b}{/a}
The only solutions I can come up with would match from {a... to .../b} when I want {a... to .../a} is there a single regexp solution, or would it be best to match the start, and then use another method to find the end from the back up, and grab it out that way? I'm using PHP 5.2 so I have all the options that entails.