Possible Duplicate:
How to parse and process HTML with PHP?
I'm not very good with regex, but I found this code:
<?php
$string = "some text (a(b(c)d)e) more text";
if(preg_match("/\((?>[^()]+|(?R))*\)/",$string,$matches))
{
echo "<pre>"; print_r($matches); echo "</pre>";
}
?>
And I'm trying to change the regex pattern to match opening and closing html tags instead of parenthesis, but I cant figure out how to mimic "[^()]+"
so that it matches tags instead of parenthesis.
The purpose of this would be to allow me to make a new html tag, whose contents I can access regardless of how many times the tag is nested within itself.
Thank you.