from regular-expressions.info (emphasis added)
Let's take one more look inside, to make sure you understand the implications of the lookahead. Let's apply q(?=u)i to quit. The lookahead is now positive and is followed by another token. Again, q matches q and u matches u. Again, the match from the lookahead must be discarded, so the engine steps back from i in the string to u. The lookahead was successful, so the engine continues with i. But i cannot match u. So this match attempt fails. All remaining attempts fail as well, because there are no more q's in the string.
does this necessarily mean that the match has to stop after this q
not followed by a u
is matched? What can come after once the q
is matched? What if we want to perform more matches after this q
not followed by a u
? eg, if I want to continue to match the rest of the letters in the word quote? q(?=u)ote
.