title: How does the ? make a quantifier lazy in regex
body: <p>I've been looking into regex lately and figured that the <code>?</code> operator makes the <code>*</code>,<code>+</code>, or <code>?</code> lazy. My question is how does it do that? Is it that <code>*?</code> for example is a special operator, or does the <code>?</code> have an effect on the <code>*</code> ? In other words, does regex recognize <code>*?</code> as one operator in itself, or does regex recognize <code>*?</code> as the two separate operators <code>*</code> and <code>?</code> ? If it is the case that <code>*?</code> is being recognized as two separate operators, how does the <code>?</code> affect the <code>*</code> to make it lazy. If <code>?</code> means that the <code>*</code> is optional, shouldn't this mean that the <code>*</code> doesn't have to exists at all. If so, then in a statement <code>.*?</code> wouldn't regex just match separate letters and the whole string instead of the shorter string? Please explain, I'm desperate to understand.Many thanks.</p>