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 reply to Re: RegEx Against Arbitrary XML Tags
by anneli
in thread RegEx Against Arbitrary XML Tags
by onegative
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |