in reply to Programmatic regex disjunction
Probably not what you're looking for, but I'd be tempted, without more context of where you're using this, to try:
But that probably doesn't quite fill your requirement, I'm betting.use List::Util qw(first); my $matched = first { $var =~ $_ } @pats;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Programmatic regex disjunction
by gaal (Parson) on Nov 21, 2005 at 17:12 UTC |