http://www.perlmonks.org?node_id=150683


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) ]