in reply to Need help comparing against a set of regexps
my @regexes = map qr/$_/, ('hello(\w+)', 'HELLO(\w+)', Hello(\w+)'); for my $re (@regexes) { if ($string =~ $re) { print "$string matched $re\n"; } }
[ ar0n -- want job (boston) ]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (ar0n) Re: Need help comparing against a set of regexps
by Anonymous Monk on Mar 10, 2002 at 07:22 UTC | |
by ar0n (Priest) on Mar 10, 2002 at 07:40 UTC |
In Section
Seekers of Perl Wisdom