Add some hints for "Restrict Possible Usernames" challenge

Is it appropriate to suggest hints that could be added to lesson hint/solution pages on the forum? If so, is this the correct place?

For example here

there are only solutions. I would suggest some hints:

  • You will need to use the | character to create two complete alternative matches
  • Both matches will need to start with ^ and end with $
  • you will need to use both the + and * in your solution

The forum is such a great resource. It would be great if there were hints for all more complicated lessons. This particular lesson is really difficult if you don’t think to use the | character.

6 Likes

I agree that some hints would be helpful, as this was my hardest challenge so far on fCC.

Alternatively, a less complex problem combining β€˜|’ and β€˜*’ operators might have made this challenge feel more approachable.

I was finally able to crack it after I rewrote the requirements based on the different test strings:

// case 1: 2+ letter username.
// case 2: 3+ character username beginning with 2 or more letters, ending with 1 or more digit.
// case 3: 3+ character username beginning with 1 or more letters, ending with 2 or more digits.

Afterwards I saw solutions with only one β€˜|’ operator, so seems its possible to tighten the logic here.

Hints or another ramp up exercise before this one. The difficulty spike from the previous challenges to this one was absurd.

2 Likes

they are like exercise school: a + b = 5 and the next is a^log( x - a) - e^x-2 = e^x.

2 Likes

I feel very disappointed by the difficulty of this challenge. I needed a previous challenge to show the logical connecting up of the various requirements, ESPECIALLY how to refer to excluding non-alpha-numeric characters, when previous easy challenges merely involved searching for the presence of something in a string.

let userCheck = /^[a-z][a-z]+\d*$|^[a-z][0-9]+\d+$/ig; 

Is my code considered as hardcoded, if so please suggest how can I improve my code.

Please create a separate topic to ask for feedback on your solution.