Tell us what’s happening:
Okay, so all the tests have been passed except for the one that says there needs to be two lookaheads. But haven’t I already used two lookaheads? I’m confused.
Your code so far
let sampleWord = "astronaut";
let pwRegex = /^\D+(?=\w*\d(?=\d)){4,}/; // Change this line
let result = pwRegex.test(sampleWord);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15
.
Challenge: Positive and Negative Lookahead
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/regular-expressions/positive-and-negative-lookahead