Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by dk (Chaplain)
on Dec 10, 2012 at 15:14 UTC ( #1008115=note: print w/ replies, xml ) Need Help??


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

Not really, because it says:

A complicated pattern tends to defeat this.

and i'm seeing exactly the opposite. I wish Tom would comment on that :) But thank you for the quote, it helps with understanding why I think that the observed behavior is bad.


Comment on Re^2: alternation in regexes: to use or to avoid?
Replies are listed 'Best First'.
Re^3: alternation in regexes: to use or to avoid?
by Anonymous Monk on Dec 10, 2012 at 15:22 UTC
    Perhaps read "complicated" as "non-trivial", EG: having alternations

      Please read the benchmark numbers.

      Alternation is MUCH faster than looping over trivial regexes, except when you use captures inside the alternations.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (14)
As of 2015-07-30 18:36 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 (273 votes), past polls