http://www.rexegg.com/regex-quantifiers.html#tempered_greed
Greedy quantifiers (default) - work by swallowing as many characters allowed before slowly reducing the amount of characters matched one-by-one in order to make way for the rest of the pattern.
For example, the regular expression .*world against the string hello world will first attempt to swallow the whole string and put it into the .*. But it cant, because then world cant match, so .* starts giving up characters one by one until it has given up the world in the original string - in which case the whole regex can match.
Lazy quantifiers - work in much the similiar way, except in reverse. They want to match as less characters as possible, and they do the same thing, adding more characters one-by-one until the rest of the pattern has a chance of matching
But according to this article I read, these seemingly identical processes for greedy and lazy quantifiers are different - in that only lazy quantifiers have the need to "backtrack". But wouldn't greedy quantifiers also need to "backtrack" when spitting out previously swallowed elements?
Why is this the case? It just seems so intuitive
