I have a question about this test
The test asks for Use lookaheads in the pwRegex
to match passwords that are greater than 5 characters long, and have two consecutive digits.
This is my answer after reading the hints:
let pwRegex = /(?=\w{6,})(?=\d*\d){2}/;
The test asks for two consecutive digits. The hint suggest /(?=\w{6})(?=\w*\d{2})/
Is the * used inside parentheses to indicate that a certain character follows another (character * character). And, if so, why does it use \w*\d{2}
? Why is \w used ? Can it be \d*\d
? Can you please explain this to me ?
Thank you!