My code is matching passwords that have numbers in the body of the password as well as at the end and I’m not sure why! Please could someone explain?
Your code so far
let username = "JackOfAllTrades"; let userCheck = /^[a-z]([a-z+][\d$]*|\d+[\d$])/i; // Change this line let result = userCheck.test(username);
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/184.108.40.206 Safari/537.36 Edg/106.0.1370.47
Challenge: Regular Expressions - Restrict Possible Usernames
Link to the challenge: