Tell us what’s happening:
According to regex101.com, my reg expression is correct. But according to FCC it is not. What am I doing wrong?
I have covered the minimum 2 chars at the beginning, only numbers at the end (or zero), and upper and lower case…what did I miss?
Your code so far
let username = "JackOfAllTrades";
let userCheck = /[\D][\D]+[\d]*$/gi; // Change this line
let result = userCheck.test(username);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1 Safari/605.1.15.
I believe \D is still numbers. \w is both alpha and numeric plus _ as well. Replace it with [a-z] and it should work. Also I don’t believe you need to make it global because there is only one username.