in reply to regular expressions help
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: regular expressions help
by da97mld (Initiate) on Nov 06, 2003 at 09:31 UTC | |
by castaway (Parson) on Nov 06, 2003 at 09:50 UTC | |
by da97mld (Initiate) on Nov 06, 2003 at 12:40 UTC | |
by Abigail-II (Bishop) on Nov 06, 2003 at 09:57 UTC |