Your code so far
let password = "abc123";
let checkPass = /(?=\w{3,6})(?=\D*\d)/;
checkPass.test(password); // Returns true
In the example above I receive the same return statement ( “true” ) for using:
/(?=\w{3,6})(?=\D*\d)/;
or /(?=\w{3,6})(?=\D+\d)/;
Is there any major difference between +
(Repeats the previous item once or more) and *
(Repeats the previous item zero or more times) when checking patterns similar to this one ?
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/positive-and-negative-lookahead