The solutions use {2,} to match 2 or more characters

Tell us what’s happening:

we were never told so far that to match certain occurrences you have to use {2,}

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; rv:70.0) Gecko/20100101 Firefox/70.0.

Challenge: Restrict Possible Usernames

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

Not true. If you look at the first solution in the hints/solutions topic for the challenge, you do not have to use {2,}.

1 Like