Regex: Restrict Possible Usernames Challenge

Regex: Restrict Possible Usernames Challenge
0

#1

The code I’m using is this:

let userCheck = /^[a-z][a-z]+\d*$/i;

This solves the problem. The given solution is however of the form

let userCheck =  /^[a-z]{2,}\d*$/i ;

which is a form I’m not familiar with. A little research shows that this is a quantifier which has not been introduced yet, and is further down the challenge list. Shouldn’t the official solutions only use the concepts that have been introduced upto that point in the challenges? Because when I looked at it for help in solving I found myself a little confused. And I am sure a few others were as well.


#2

Without knowing the exact challenge, it is hard for me to say.
What do you mean by quantifier? The {2,} ?


#3

Yes, the quantifier is the{2,}.
The challenge is here: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames

A couple of challenges below is the challenge: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches that introduces this exact quantifier. Maybe this challenge needs to be moved up the line to before the challenge to restrict usernames?


#4

Where did you find the given solution?


#5

Clicking the “Get a Hint” button shows the guide page and at the bottom is the solution. Usually. Some challenges still do not have a solution, because of the somewhat recent restructuring of the course, but the hardest ones do and the ones that are missing are regularly added to.


#6

I imagine that the hint is older than the new curriculum.