Tell us what’s happening:
Is this the order the Regex is going through when testing?
- ^[a-z] : the pattern must start with a letter
- [a-z]+ : the letter must be followed by one or more letter
- \d*$ : if there is 0 or more numbers they must be after the letters
- i : case insensitive
My issues :
if I delete \d*$ and my string is “as12”, it returns true. Why return true if there is no regex for numbers?
if the character $ means “match at the end of the string” why would it matter if I placed \d*$ at the start of the regex. Conversely if ^ outside of  means match at the beginning why would it matter where ^[a-z] is placed?
Your code so far
let username = "JackOfAllTrades"; let userCheck = /^[a-z][a-z]+\d*$/i; // 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/67.0.3396.87 Safari/537.36.