I\'m trying to understand how negative lookaheads work on simple examples. For instance, consider the following regex:
So, in that case the regex matches any string that contains strictly 3 characters and is not the abc
This is not quite right. This regex states that we are searching a sequence which firstsymbol is a and after that is c, and inside there is no b.
For example, a(?!b). will match either ac or af as there is no restrictions on the last symbol via .