Need help on Restrict Possible Usernames

Tell us what’s happening:
Don’t know why the regular expression code not working.
I used regexr it showing correctly.
redexr link :

Your code so far

let username = "JackOfAllTrades";
let userCheck = /[a-z]+\w+/gi; // Change this line
let result = userCheck.test(username);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.181 Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:

Take a look at regexr again. It shows that the capital ‘J’ is not matching with this regex. Make sure to copy/paste the string to avoid typos

look I think its working properly on regexr. but in fcc challenge it can’t match “JACK” and “RegexGuru”


after running literal expression it can’t find.

Never mind my previous advice. I got it to work on my mobile browser. Don’t know why it was wrong on my desktop yesterday.

Try clearing your cookies. Sometimes fcc database gets corrupted

Tried clearing cookies even cache still not working.

It’s weird. It looks like they’re looking for a very specific regex, which you had so I can get it to pass with this


i found the solution. I remove “g” flag and it worked.


let userCheck = /[a-z]\w/gi;

1 Like

Do you know why this is the case? After reading this, that’s what I had to do for mine as well

I don’t know may be it is a word so “g” flag is unnecessary.