question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restrict Possible Usernames challenge is in the wrong place

See original GitHub issue

Describe your problem and how to reproduce it: To solve the challenge for Restrict Possible Usernames you need to understand “quantity specifiers” (e.g. {2,}).

Quantity specifiers aren’t taught until a few lessons later in the Curriculum (Specify upper and lower number of matches).

Suggest moving the Restrict Possible Usernames challenge a few places down the Curriculum.

Note: This is a duplicate of issue 25676, but is still ongoing.

Add a Link to the page with the problem: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames and: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches

Tell us about your browser and operating system:

  • Browser Name: Mozilla Firefox
  • Browser Version: 67.0.1
  • Operating System: Ubuntu

If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): Screenshot_2019-06-08 Welcome to learn freeCodeCamp

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
greenboyroycommented, Jul 4, 2019

Hi all,

I know this issue was closed but I have just hit the same wall. Unsure of how to solve the challenge, I clicked ‘Get a hint’ which lead me to a solution containing code that had yet to be taught in the curriculum. From the perspective of someone learning this material, it’s a bit of a kick in the teeth that the ‘solution’ provided is something I couldn’t possibly know just by going through the curriculum.

As quantity specifiers come later, I would suggest moving this challenge or changing the solution to an alternative method containing only expressions used so far (even if it isn’t the most elegant). Maybe: /^[a-z][a-z]+\d*$/i; ?

PS This is my first contribution here (at least I hope it is a contribution) so apologies if I’m doing it wrong!

1reaction
ShaunSHamiltoncommented, Sep 21, 2020

@sultanofcardio The solution you see in the md file is used only by devs to test if their changes prevent the challenge from passing a solution.

This topic was discussed on the forum here: https://forum.freecodecamp.org/t/restrict-possible-usernames-solution-requires-knowledge-not-introduced/395660/7

The guide post has the visible solution, and it has been updated with a perfectly suitable solution:

let username = "JackOfAllTrades";
let userCheck = /^[a-z][a-z]+\d*$|^[a-z]\d\d+$/i;
let result = userCheck.test(username);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Restrict Possible Usernames (freeCodeCamp Challenge)
Hi! :DThis is a challenge that I struggled with, which I came back to over several days to try and figure out what...
Read more >
freeCodeCamp Challenge Guide: Restrict Possible Usernames
Restrict Possible Usernames. Solutions. Solution 1 (Click to Show/Hide) let username = "JackOfAllTrades"; let userCheck ...
Read more >
Restrict Possible Usernames: problem description is incorrect
The Restrict Possible Usernames assignment asks you to write a regexp for a username that meets the following criteria:.
Read more >
Help:I have been blocked - Wikipedia
Problem with your username - your username was unsuitable and has been blocked; you need to choose another before continuing.
Read more >
Account authentication and password management best ...
Allow for third-party identity providers if possible ... A site with tight restrictions on usernames may offer some shortcuts to developers, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found