@regex = ( 'foo' 'b[a-z]' ); $string = 'foo'; my $matched = 0; foreach $test ( @regex ) { $matched++ if ($string =~ m/$test/); } if ($matched) { ...