Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I just want to capture 500, 501, 502, 531, 532 Any ideas how to achive this using the range symbol? Thanks.500 501 502 503 504 508 522 531 532 505
while (<DATA>){ chomp; $tag = $_; #if ($tag =~ /50[0-2]/ || $tag =~ /5[30-33]/){ if ($tag =~ /50[0-2]|5[30-33]/){ print "$tag\n"; } } __DATA__ 500 501 502 503 504 508 522 531 532 547 548 555 444 505
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Range Issue with RegEx
by liverpole (Monsignor) on Jul 10, 2006 at 14:19 UTC | |
|
Re: Range Issue with RegEx
by VSarkiss (Monsignor) on Jul 10, 2006 at 15:59 UTC | |
|
Re: Range Issue with RegEx
by ptum (Priest) on Jul 10, 2006 at 14:35 UTC | |
|
Re: Range Issue with RegEx
by grinder (Bishop) on Jul 10, 2006 at 16:19 UTC | |
|
Re: Range Issue with RegEx
by TedPride (Priest) on Jul 10, 2006 at 18:36 UTC |