How {specific numbers} regex matches less characters with less number?

Tell us what’s happening:
how come this code below matches the “bana12” test?
when letters at first should be greater than 5?
the challenge itself dictates that!

Use lookaheads in the pwRegex to match passwords that are greater than 5 characters long, do not begin with numbers, and have two consecutive digits.


my code so far

let sampleWord = "astronaut";
let pwRegex = /^(?=\w{6})(?=\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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36.

Challenge: Positive and Negative Lookahead

Link to the challenge:

\w does not mean letter. It is the equivalent of writing [0-9a-z-A-Z_].