I was trying a lot of combinations, but whenever i change the lookaheads in the tests always keep exchanging the correct code for 8pass99 and 12abcde for bana12 and abc123, i don’t know what i’m doing wrong.
Can someone help me understand what’s wrong?
Your code so far
let sampleWord = "astronaut";
let pwRegex = /(?=\D*\w{6,})(?=\D*\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; rv:82.0) Gecko/20100101 Firefox/82.0.
One of the requirements for this challenge was to create a regex that does not begin with numbers . So you need to add that symbol to your regex.
Also, there is a great tool you can use where you can test out your regex and it will provide you with detailed explanations of what is happening. Like a debugger.
Sorry for my poor communication. So if you left it the way it was where ^D\* was at the beginning then you only have to change this part \D+ to this \w*
Regex is weird and was confusing for me too.
I would definitely bookmark that regex 101 site because you will need it for the telephone validator project at the end. It helped me out alot.