Hello everyone, first time posting on this forum as I am looking for some assistance understanding what is happening with my current code. I passed the challenge but do not feel that my code is ensuring that the password contains more than 5 characters, perhaps I am wrong but if someone could help me break down what happens in here and if my code actually checks if a password contains 5 or more characters. I used an online IDE for my code to check it myself and it returned “True” even if it contains less than 5 characters. Apologies in advance if this post isn’t properly formatted, thank you all!
Here is my code:
let sampleWord = "a12";
let pwRegex = /(?=[A-Z+])(?=\w\d{2})/i; // Change this line
let result = pwRegex.test(sampleWord);