in reply to multiple options for pattern match help
If you don't need to know which type matched, useif ($string =~ m{(int|char|bool|long)}) { print "found $1\n"; }
This can be significantly faster, especially for big strings. Update: Thanks sundialsvc4 :).if ($string =~ m{(?:int|char|bool|long)}) { print "found\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: multiple options for pattern match help
by locked_user sundialsvc4 (Abbot) on Jan 08, 2008 at 16:46 UTC |