What does (?=.*[^a-zA-Z]) mean
I am a beginner in regex and not getting what does it mean .
Is it like, dot(.) means any character so .* means any character any number of times and [^a-zA-z] any one character except a-z and A-Z.
what string will match it?
Thanks,
Puneet
That is positive look ahead assertion.
That means that there are at least one symbol that is not
a-ZA-Zto right from the point.Example:
In the first line there are no
not a-zA-Zafter2. And the line will not be shown.In the second line I’ve added point to the end. Now there is a
not a-zA-Zafter2. And the line will be found and shown.