in reply to Pattern Search on HTML source.
I very strongly agree: do not use regular expressions to parse HTML code. Do not treat the input that you have been given as a “string.”
Use one of the many HTML-parsing tools already mentioned to transform the HTML input into a data-structure consisting of Perl hashes and lists. Then, navigate through the structure. (You can even find assistance, in so-called “XPath expressions,” to do that part without having to write custom code.)