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

The greedy operators are optimized.

If they are optimized, this is new in 5.6. What happens with something like /^.*"/ is the dot star will match everything up to the end of the string. Then, when the regex "realizes" that it has something to match after the dot star, it starts backtracking. This is involves going to the previous character and checking to see if it matches and repeating this until a match occurs (it's more complicated than that, but that's the gist of it). With a complicated string and regex, this backtracking gets quite hairy. That's why it's best to avoid using the dot metacharacter when appropriate.