laziness, impatience, and hubris | |
PerlMonks |
Re: Range Issue with RegExby grinder (Bishop) |
on Jul 10, 2006 at 16:19 UTC ( [id://560180]=note: print w/replies, xml ) | Need Help?? |
I just want to capture 500, 501, 502, 531, 532 Currently you want to do something like /5(?:0[012]|3[12])/, although in the development version of Perl, which will one day be released as 5.10, you are better off (thanks to the work of Yves Orton) by just listing the alternations, and let the regexp engine build a trie out of the alternatives: /500|501|502|531|532/. This is fast. • another intruder with the mooring in the heart of the Perl
In Section
Seekers of Perl Wisdom
|
|