Regexp example given in the tutorial not working for me.
The Example is
A more practical use of lookaheads
is to check two or more patterns in one string. Here is a (naively) simple password checker that looks for between 3 and 6 characters and at least one number:
let password = “abc123”;
let checkPass = /(?=\w{3,6})(?=\D*\d)/;
checkPass.test(password); // Returns true
But when i check this example -
let password = “988abcdefgh”;
let checkPass = /(?=\w{3,6})(?=\D*\d)/;
console.log(checkPass.test(password));
The result returns True even though there are more than 6 characters