|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Re: RegEx Against Arbitrary XML Tagsby anneli (Pilgrim) |
| on Oct 19, 2011 at 23:09 UTC ( #932524=note: print w/ replies, xml ) | Need Help?? |
|
GrandFather's answer is certainly the right way to go, but while we're here, let's look at your regular expression: if($line =~ /^\s*<(\w+)>[^\w*|\d*|<]/)Breaking it down:
I'm not quite sure what you wanted at the end there, but parens ((...|...)) are probably closer than a character class ([]).
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||