Parsing HTML by hand is always fragile, and in my experience never ends well. Have you considered a module like HTML::TreeBuilder and then use its look_down method to select just the elements you're interested in?
In reply to Re: Example of inconsistent regex matching
by RichardK
in thread Example of brainfog (Was: inconsistent regex matching)
by ww
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |