Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: alternation in regexes: to use or to avoid?

by dave_the_m (Parson)
on Dec 10, 2012 at 19:40 UTC ( #1008157=note: print w/ replies, xml ) Need Help??


in reply to Re^2: alternation in regexes: to use or to avoid?
in thread alternation in regexes: to use or to avoid?

Actually I stand corrected: the fixed string prefixes are collected together into a trie where there are (possibly differing) wildcard suffixes; the killer is the individual captures, which disables the trie optimisation.

So, alternation is the fastest, as long as you put any captures outside the alt.

Dave.


Comment on Re^3: alternation in regexes: to use or to avoid?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008157]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2015-07-31 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls