good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: pattern matching with large regexby fishbot_v2 (Chaplain) |
on Aug 13, 2005 at 17:55 UTC ( [id://483582]=note: print w/replies, xml ) | Need Help?? |
Or instead of handcrafting it, use something like Regex::PreSuf, which groups substrings by longest prefixes (among other things). If you are using a static set of alternations, I would recommend caching this somehow, though, it is rather expensive time-wise. Additionally, it isn't guaranteed to be faster, so benchmark with reasonable data. (see Re^4: removing stop words for example with benchmark.)
In Section
Seekers of Perl Wisdom
|
|