Note that the results for the examples of the two methods differ:
See haukex's Building Regex Alternations Dynamically.c:\@Work\Perl\monks>perl -wMstrict -le "my @cases = qw/ABA SCO ACC PHC GHF/; my $re = join '|', @cases; ;; for my $text ('SCO', 'ENDOSCOPE', 'Microsoft') { print qq{'$text' found (grep)} if grep { $text eq $_ } @cases; print qq{'$text' found (regex)} if $text =~ /^$re$/; } " 'SCO' found (grep) 'SCO' found (regex) 'ENDOSCOPE' found (regex)
Give a man a fish: <%-{-{-{-<
In reply to Re^2: Sparing multiple 'or's
by AnomalousMonk
in thread Sparing multiple 'or's
by Denis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |