Generally speaking, parsing HTML files using regular expressions is a dangerous business. There's always just one more complication to take into account.
A far better approach is to use a proper HTML parser. The HTML::Parser module is available from CPAN, but it seems to me that one of it's sub-classes HTML::TokeParser or HTML::TreeBuilder might be more appropriate in this case. There's a particularly good article on HTML::Treebuilder in the current Perl Journal (issue 19).
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to Re: Pattern matching html.
by davorg
in thread Patern matching html.
by zzspectrez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |