Tell us what’s happening:
It’s failing for the testcase “8pass99” not sure why,
ie: sampleWord = “8pass99”;
Your code so far
let sampleWord = "astronaut";
let pwRegex = /(?=\w{5,})(?=[\D]+[\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/85.0.4183.83 Safari/537.36
.
Challenge: Positive and Negative Lookahead
Link to the challenge: