Lessons in wrong order in Regular Expressions

The expected solution for the “Restrict Possible Usernames” lesson relies on {min, max} syntax, which isn’t introduced until three lessons later (“Specify Upper and Lower Number of Matches”). These lessons should be reordered so that “Restrict Possible Usernames” comes after the “Specify number of matches” lessons - and since it feels like a capstone lesson, perhaps it should come at the end of the lesson group.

If by “expected solution” you mean one of the solutions offered in the Hints, then try to remember that those hints are not intended to be read as the “right” or “best” solution. They are written by members of the community. The solution may have been written when Free Code Camp was organized differently, or the person who contributed a solution may simply already had some knowledge of regular expressions.

If that’s the case, then we have two problems:

  • The user-provided solution has not been vetted to make sure that it adheres to the lesson plan
  • I have prior knowledge of regular expressions, and the parser did not accept several other solutions that would have completed all of the criteria. (I tested the other solutions using the ECMAScript parser at regex101 .com .)

If you have a regular expression that you believe satisfies all of the requirements, then you should open a bug against the challenge. I believe that the way the tests work is simply to use the regex that you write with a test method, so FCC doesn’t check for specific patterns.

I’ll do that when I have the opportunity. Thank you.