Tell us what’s happening:
Hey guys,
I have one error for the Positive & Negative Lookahead challenge, but I am not sure how to fix it. “8pass99” should not match but it does. I know it’s because matching passwords aren’t supposed to start with a number, but I am not sure how to fix my code.
Looking forward to some help on this one!
Your code so far
let sampleWord = "astronaut";
let pwRegex = /(?=\w{6,})(?=\D+\d{2})/; // Change this line
let result = pwRegex.test(sampleWord);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
.
Challenge: Positive and Negative Lookahead
Link to the challenge: