As other people have suggested I also find the explanations in the course short and abstract. Can somebody tell me if the first code does the same as the second?
let sampleWord = “astronaut”;
let pwRegex = /(?=\w{4,}(?=\d{2,}))/; // Change this line
let result = pwRegex.test(sampleWord);
let sampleWord = “astronaut”;
let pwRegex = /(?=\w{6})(?=\w*\d{2})/;
let result = pwRegex.test(sampleWord);
The second is taken from the solution page and the first is mine. The strange thing is that the first covers all requirements except for
Your regex should use two positive lookaheads
.
Can somebody tell me if I were close to the truth cause at the end I just gave up and checked it.