Hi all,
Newbie question for the lesson Regular Expressions: Positive and Negative Lookahead:
I need to use lookaheads in the pwRegex
to match passwords that are greater than 5 characters long, and have two consecutive digits.
My question is why does the below work, where the second lookahead needs \w* which i thought was zero or more?
(?=\w{6,})(?=\w*\d\d)
I thought that (?=\w{6,})(?=\d\d)
should work, i presume i am missing something fundamental and basic here.
If i were to have a sampleWord “abcdef12” it would fail (with my second look ahead) but pass with sampleWord “123456”
Thanks,