Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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

by Anonymous Monk
on Dec 10, 2012 at 16:44 UTC ( #1008139=note: print w/replies, xml ) Need Help??

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

The amount of time the regex takes to execute is insignificant in the long run. What matters is how much I/O the program does or doesn't do, and that includes virtual-memory. Process the data in reasonably sized chunks, applying whatever you might know about which test is most likely to succeed first. Make the whole thing easy to maintain. Don't sweat nanoseconds when it's milliseconds that matter.
  • Comment on Re: alternation in regexes: to use or to avoid?

Replies are listed 'Best First'.
Re^2: alternation in regexes: to use or to avoid?
by balker (Novice) on Dec 10, 2012 at 18:46 UTC
    Thank you, but your statement is contradicting itself. We're seeing milliseconds wasted in the regex (for a web-app!), which is why we bothered to examine why in the first place.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008139]
[Lady_Aleena]: Would you use a module that is almost 150 characters to type with the use and importing all subroutines?
[LanX]: use module :all ?
[Lady_Aleena]: Lax, that would take it down to a little less than 100 characters. The module name is nearly 80 characters long.
Lady_Aleena has fumble fingers today.
[Lady_Aleena]: Sorry for the name typo LanX.
[LanX]: never lad_ena!
[LanX]: ;)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2017-05-24 21:56 GMT
Find Nodes?
    Voting Booth?