in reply to Re: Would study help this regexps performance?
in thread Surprisingly poor regex performance

study only really helps (ie. saves time) if you are going to be searching the studied string multiple times to offset the cost of the studying itself

And in this case, I'm searching the string only once, so it almost certainly would have hurt rather than helped.

  • Comment on Re^2: Would study help this regexps performance?

Replies are listed 'Best First'.
Re^3: Would study help this regexps performance?
by BrowserUk (Patriarch) on Dec 15, 2004 at 16:24 UTC

    I agree. I think that judicious use of the cut operator (?>...) may have helped your original regex avoid backtracking, but I haven't done any benchmarking to prove that thought.


    Examine what is said, not who speaks.        The end of an era!
    "But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
    "Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon