Certainly it is, but it seems to be far beyond your capabilities. Which is why I recommend you use HTML::Parser or HTML::TreeParser. They are quite fast and you haven't shown that the time is actually spend in code from HTML::Parser.
OK. All I am trying to say is for little bit of information I don't want to load document. I will spend more time on RegEx then loading a parser that I don't need too. Besides I can either get XML or HTML document.
Please don't take it the wrong way. I don't mean to go against you. You have helped me lots of time and this site has been really great for me. Its just that I want to be able to use perl and keep things a fast as possible. I want to keep my project. I don't want anyone saying perl is slow form my dept.
Regular expressions with potentially zero-width wildcards (especially .*) can be exceedingly slow. If someone claims Perl is slow because it handles a difficult regular expression with due care, then that simply shows a lack of understanding on their part. Perl contains a regular expression engine, as do many other languages--but regular expression syntax is a language unto itself.
Part of the advantage of using a module is that you get to take advantage of the effort someone else has gone to to get the regular expression right and (hopefully) efficient.