I think you were expecting the lookahead assertion to match the characters following '*' if they weren't 'abc'. That's not how it works. All it does is create a condition that must be met in order for the preceding part of the pattern (the '*') to be matched.

Your pattern "looked" at the string, saw that the '*' wasn't followed by 'abc', and so it matched the '*' and moved on to the next part of the pattern. The next part of the pattern said to match another '*', but in the string we're only up to the 'a' in 'abd', so it failed to match.

I doubt that helped you understand lookahead assertions, but that's the best that I can explain it.


Spelling mistakes, grammatical errors, and stupid comments are intentional.