Pragmatically, trying to match balanced tags (as HTML is supposed to be) with a regular expression is an exercise in futility for any data which you don't generate yourself, from another program. There are just too many corner cases which pop up surprisingly often.
In reply to RE: Backwards searching with regexps
by chromatic
in thread Backwards searching with regexps
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |