Tell us what’s happening:
With the below regex, every test case passes except:
Failed: Your regex should match the string Z97
Is there a way to solve the problem without using a | pipe?
If it is, could you give me a hint?
Your code so far
let username = "JackOfAllTrades";
let userCheck = /^[a-z]{2,}\d*$/i; // Change this line
let result = userCheck.test(username);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Challenge: Regular Expressions - Restrict Possible Usernames
Link to the challenge: