my @regexes = qw/re_1 re_2 re_3 re_4 .../; my %result = (); foreach my $re (@regexes) { $result{$re} += $string =~ /$re/; } # Save the number of matched regexes my $count = grep defined $_ && $_ > 1, values %result;
In reply to Re: mutual exclusion of regexes
by Bloodnok
in thread mutual exclusion of regexes
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |