Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Interesting behavior of regular expression engine

by rjt (Deacon)
on Mar 12, 2013 at 23:51 UTC ( #1023079=note: print w/ replies, xml ) Need Help??


in reply to Re: Interesting behavior of regular expression engine
in thread Interesting behavior of regular expression engine

I have to agree with tobyink on this one. Regexes are supposed to provide stable output given a set of well-defined rules (which thanks to p5p they pretty much always have, without fail). What's not well-defined is what steps the underlying implementation takes to arrive at the output, and that's a Good Thing, as some of the optimizations this enables are quite profound indeed. I don't get the sense that you (the OP) are advocating this weird execution side effect not working as being a bug that needs to be fixed, but nonetheless feel it important to underscore my own strong preference for end-result correctness first, performance second, and weird effects likely to break tomorrow coming in a distant third.


Comment on Re^2: Interesting behavior of regular expression engine
Reaped: Re^3: Interesting behavior of regular expression engine
by NodeReaper (Curate) on Mar 14, 2013 at 07:48 UTC
Re^3: Interesting behavior of regular expression engine
by 7stud (Deacon) on Mar 14, 2013 at 07:48 UTC

    What's not well-defined is what steps the underlying implementation takes to arrive at the output,

    Yet, "Programming Perl 3rd" lays out 6 very complicated rules describing in detail how the regex engine proceeds (p 197-201). So, Larry at least thinks the steps are/were well defined. I wonder if those steps are in the new edition?

      So, Larry at least thinks the steps are well defined.

      I don't know what you're talking about, but that book is 12 years old at least, and larry himself hasn't touched the regex engine in about as long , optimizations have been added, things have changed

        Ok, I've read the rules in 5.9.4. The Little Engine That /Could(n't)?/ and they are prefaced with for this discussion we're pretending the optimizer doesn't exist. , pretty much what we've been saying

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2014-12-28 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls