Been beating my head against a wall trying to get this to work - help from any regex gurus would be greatly appreciated!
The text that has to be matched
[template option="whatever"]
<p>any amount of html would go here</p>
[/template]
I need to pull the 'option' value (i.e. 'whatever') and the html between the template tags.
So far I have:
> /\[template\s*option=["\']([^"\']+)["\']\]((?!\[\/template\]))/
Which gets me everything except the html between the template tags.
Any ideas?
Thanks, Chris
<p>this is how you break a parser: [/template] It's broken now! </p>is the html?[/template]tag, but otherwise you should be able to access the contents of the parens by number! For the HTML, you can simply try a "reluctant".*(probably.*?but I'm not familiar with PHP). Also be aware, of course, that youroptionvalue should not be empty or contain escaped"chars, otherwise this will not work ...