Tell us what’s happening:
I’m not sure why my code isnt passing the tests " Your regex should not match BadUs3rnam3", “Your regex should match Z97” and “Your regex should not match c57bT3”
Your code so far
let username = "JackOfAllTrades";
let userCheck = /^[A-Z][\d]*$|[A-Z{2}]/ig; // Change this line
let result = userCheck.test(username);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
.
Challenge: Restrict Possible Usernames
Link to the challenge: