This will allow you to put together things such as:\d - a digit \w - a word character \s - whitespace.
foreach my $line ( @lines ) { next unless $line =~ m/^\d{6} \w{3}/; # Will match '111111 aaa' where 1 is any # number, a any char. next unless $line =~ m/^\d+\s+\w+/; # Will match any number followed by any word. # The '^' anchors the search to the beginning # of the string. }
--tidiness is the memory loss of environmental mnemonics
In reply to Re: regular expressions help
by EvdB
in thread regular expressions help
by da97mld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |