I got the right answer, but I don’t understand why c57bT3 isn’t a match
The answer:
let username = "JackOfAllTrades";
let userCheck = /^([a-z]{1,}\d{2,}|[a-z]{2,})[0-9]*$/i; // Change this line
let result = userCheck.test(username);
To me the alternative on the left side of the “|” should be triggered because c57bT3 has 1 letter, and at least 2 numbers at the start. There are also 0-infinite digits at the end of the code (I’m referencing the [0-9]*$). What is it about this regex and string that makes them not match?
Thank you for any help!
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36
.
Challenge: Restrict Possible Usernames
Link to the challenge: