"be consistent" | |
PerlMonks |
Re:{3} Regex For HTML Image Tags?by jeroenes (Priest) |
on Mar 27, 2001 at 14:21 UTC ( [id://67466]=note: print w/replies, xml ) | Need Help?? |
I had been munging on a regex as well (just an exercise),
and I think the extended regex clearifies a bit:
This works, but keep in mind that the IMG tag is still valid if for example, the SRC and the ALT are reversed in order. That's why HTML::Tokeparser (as Desdinova pointed out already) or maybe even (if the HTML is yours) Template Toolkit are better approaches. Cheers, Jeroen
In Section
Seekers of Perl Wisdom
|
|