in reply to RE: How are we lazy?
in thread How are we lazy?

Thank you! I don't know why I didn't think of forward tracking. Looking at all of the other results in light of this, they make perfect sense (even though I thought they were a little odd before). Tomorrow, you will get a ++ vote from me :)

Actually, I think lazy has to be slower than a negated character class. Basically, either greedy or lazy quantifiers using the dot metacharacter are forced to back- or forwardtrack. That nasty little dot will match with anything that it can get its grubby little hands on and will cause the regex to "overshoot" which greatly increases the amount of necessary backtracking or forwardtracking.

With the character class, Perl creates what amounts to a seive. Characters which match (or don't match, in the case of a negated character class) pass through the seive. When we get a non-allowed character, it stops, period. There is no "tracking" which occurs afterwards to clean up.