my $str = $_; my $matched = scalar grep { $str =~ /$_/ } @regexes;