in reply to regex to match words and numbers
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex to match words and numbers
by AnomalousMonk (Archbishop) on Jun 08, 2011 at 16:28 UTC | |
by moritz (Cardinal) on Jun 08, 2011 at 19:45 UTC | |
by AnomalousMonk (Archbishop) on Jun 09, 2011 at 11:49 UTC | |
by doubledecker (Scribe) on Jun 09, 2011 at 06:16 UTC |