Regular Expressions - Restrict Possible Usernames

Tell us what’s happening:

let username = “JackOfAllTrades”;
let userCheck = /[1]{2,}\d*$/; // Change this line
let result = userCheck.test(username);

your regex should match the string Z97 ------this is my problem

Your code so far

let username = "JackOfAllTrades";
let userCheck = /^[A-Za-z]{2,}\d*$/; // 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/126.0.0.0 Safari/537.36

Challenge Information:

Regular Expressions - Restrict Possible Usernames


  1. A-Za-z ↩︎

You could use an | (Disjunction)

Starts with two letter or more, ends with zero or more numbers

OR

Starts with one letter or more, ends with two or more numbers