Tell us what’s happening:
The language strikes me as ambiguous.
Your code so far
/(?=.{6,})(?=\d\d)/;
This checks that the string is “greater than 5 characters long” and has “two consecutive digits.” no?
Seems like all answers require for the second lookahead that it references any number of non-digit numbers before the two digits, but why is that necessary?
let sampleWord = "astronaut";
let pwRegex = /(?=.{6,})(?=\d\d)/; // Change this line
let result = pwRegex.test(sampleWord);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Challenge: Regular Expressions - Positive and Negative Lookahead
Link to the challenge: