The textbook answer will be "Don't use a Regex to parse HTML, use a parser!" (such as HTML::Parser, HTML::TokeParser).
If you're really bent on doing it the quick and dirty (and wrong) way, you might want to look at turning your .*'s into .*?, and read on up greediness in perlre to see why.
In reply to Re: Multiple line regex match
by edan
in thread Multiple line regex match
by dogen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |