Restrict Possible Usernames

Restrict Possible Usernames
0.0 0

#1

Tell us what’s happening:
I’ve verified this regex expression using https://regexr.com/ already, but the exercise keeps telling me that I’m failing to include “JACK” and “RegexGuru.”

Is there something wrong with my regex or is the exercise buggy?

Your code so far


let username = "JackOfAllTrades";
let userCheck = /[a-z][a-z]+\d*$/gim; // Change this line
let result = userCheck.test(username);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames/


#2

Just worked through the challenge myself to see what was going on and you only need the case insensitive option at the end.

:slight_smile:


#3

Haha oh my goodness. Thank you!!