onion2k has asked for the wisdom of the Perl Monks concerning the following question:
However, commonsense tells me that if theres a large number of patterns thats going to be really slow. Is there, in the classic Perl sense, another way to do it?foreach $pattern (@patterns)) { if ($input =~ /$pattern/) { print $pattern; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: More than one regexp.
by danger (Priest) on Jan 19, 2001 at 19:51 UTC | |
|
Re: More than one regexp.
by I0 (Priest) on Jan 19, 2001 at 15:27 UTC | |
|
Re: More than one regexp.
by RatArsed (Monk) on Jan 19, 2001 at 14:34 UTC | |
by eg (Friar) on Jan 19, 2001 at 15:05 UTC | |
by dws (Chancellor) on Jan 19, 2001 at 22:15 UTC | |
|
Re: More than one regexp.
by kschwab (Vicar) on Jan 19, 2001 at 18:46 UTC |