Tell us what’s happening:
Your code so far
let sampleWord = "astronaut";
let pwRegex = /(?=\w{5,})(?=\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:69.0) Gecko/20100101 Firefox/69.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/positive-and-negative-lookahead
this is what i dont understand here. i get the instructions what to do for the code and this is where they put a wrench of the given solution on the website with \D*. you are asked to write a code with greater than 5 characters and have two digits. why does this need to be called \D* where the instruction specifically asks for digits and characters and not for non characters.