Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
See, this is why you should never try to parse arbitrary HTML with regular expressions. Your regex doesn't handle a number of very common occurances. The first thing that springs to mind is tags with attributes - the tag name will be upper-cased, but the attribute names will be left untouched. The original poster was unclear as to what sohuld be done in those circumstances. Also can you be sure that every < character in the document starts a tag? What if it was in a CDATA section? All in all, I think it's far better to use an HTML parser. They are there to be used, so why not use them?
-- <http://dave.org.uk> "The first rule of Perl club is you do not talk about
Perl club." In reply to Re^2: Converting HTML tags into uppercase using Perl
by davorg
|
|