I thought I understood these charagter regex thing but after seeing the solution (/[1] [a-z]+\d*$|[2] \d\d+$/i;), I don’t.
The exercise literally states “A two-character username can only use alphabet letters as characters.” so what is \d* doing in the expression?? If I am not wrong, the * means 0 or more numbers NOT 0 numbers. The code explanation just confuses me more about when now to use + and *.
Your code so far
let username = "JackOfAllTrades";
let userCheck = /change/; // 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/102.0.0.0 Safari/537.36
Challenge: Restrict Possible Usernames
Link to the challenge: