So the question asks for two look aheads and an array of password samples that must be tested and the code I have seems to satisfy all the criteria… I even used two lookaheads but the problem keeps telling me I need two lookaheads
Your code so far
let passRegex = /(?=^[A-Za-z]\w[^_]+(?=\d\d+)){6,}/;
let sampleWord = "astronaut";
let pwRegex = /(?=^[A-Za-z]\w[^_]+(?=\d\d+)){6,}/; // 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/86.0.4240.183 Safari/537.36.
one lookahead for the length requirement, the other for the type of characters
one thing to remember: lookaheads are zero-width, they don’t actually match characters, but a position (followed by the required characters), so using a counter after a lookahead does nothing