Regex: Balancing Groups
Has anyone ever seen an example of a regex using balancing groups that isn't the O'Reilly book's lone example with parentheses balancing? Someone, somewhere must have used it once.
In other related regex query news, SomeWord(?!([^<]*?)</a>) will find me all instances of Someword that aren't inside the business end of a closing link tag. Except if there are tags nested inside the link tag.
In other words, knows to ignore
<a href=”#”>SomeWord yada...</a>
doesn't know to ignore
<a href=”#”><strong>SomeWord yada...</strong></a>
(which isn't great form per se, but let's say I don't get to write all the html in the world). I think my brain is jammed.