while (my $data = <DATA>) { next if $data =~ /^[\pL\pN.*]/; # do something with non-rejected $data here }
\pL matches a letter, \pN a digit ("number"). Note that \w wouldn't work here, because it also matches the underscore.
In reply to Re: regex to match words and numbers
by moritz
in thread regex to match words and numbers
by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |