>>>>> "perlocean" == perlocean  <[EMAIL PROTECTED]> writes:

perlocean> you mean, ?
perlocean> @tags = $html =~ /<!--\s*(.+?)\s*-->/g;

And that's still wrong.

<!-- in comment -- --> in comment <-- -- in comment -->

All three of those phrases are officially "in comment".  That's
because "--" is actually a "toggle", and you have to be in the right
toggle state to recognize the ">".

Yes, it's trickier than it looks.

That's why you should use HTML::Parser, and STOP WRITING REGEX TO PARSE
HTML.

Sheesh.  How many times do I have to repeat this here? :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to