- or download this
grep { $string =~ /$_/ } @regex;
- or download this
if ( grep { $string =~ /$_/ and return 1 } @regex ) {
...
}
- or download this
sub is_match {
grep { $string =~ /$_/ and return 1 } @regex;
...
if ( is_match() ) {
print qq($string matched some regex);
}