Tell us what’s happening:
Hello ! I have some problems with RegExp. I solve this challenge but why this code does not work : /(?=\w{5,})(?=\w*\d{2})/ ? Can someone explain me the meaning of this solution below ? Thanks
Your code so far
let sampleWord = "astronaut";
let pwRegex = /(?=\w{6})(?=\w*\d{2})/; // 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/90.0.4430.72 Safari/537.36
.
Challenge: Positive and Negative Lookahead
Link to the challenge: