Update Curriculum Order and fix tests

This challenge introduces the curly brace regex but shows up a couple challenges AFTER the “Restrict Possible Usernames” challenge. But I had to use the curly braces to solve that one. Also n the Restrict Possible Usernames challenge the descriptions states as the 4th test:
4) Usernames have to be at least two characters long. A two-character username can only use alphabet letters as characters.

There are tests for “Jo” which should match, “A1” which should NOT match, and “Z97” which SHOULD match.

Your code so far
This is the code I had to use to solve the problem in that challenge:
let username = “JackOfAllTrades”;

let userCheck = /^a-z$/i;

let result = userCheck.test(username);


let ohStr = "Ohhh no";
let ohRegex = /change/; // Change this line
let result = ohRegex.test(ohStr);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36.

Challenge: Specify Upper and Lower Number of Matches

Link to the challenge:

You don’t need to use curly braces to solve the “Restrict Possible Usernames” challenge.

are you saying there is something wrong with these tests? I do not understand


you do not need to use curly braces… for example a{2,} has the same exact behavior of aa+, and this last thing was arleady introduced in the curriculum

Yes, I am saying the tests do not follow what the given instructions are.

can you please link the challenge you are talking about? you have opened two topics linking to two different challenges and then talking about a third

that makes it difficult answering your concenrs

Sure:

^[a-z]([0-9][0-9]+|[a-z]+[0-9]*)$

Braces are not required.

thank you for the info. I have since went back and fixed my answer to not include the curly brace. The tests I mentioned however, are still logically inconsistent with the instruction given.

Here are the requirements:

  1. Usernames can only use alpha-numeric characters.
  2. The only numbers in the username have to be at the end. There can be zero or more of them at the end. Username cannot start with the number.
  3. Username letters can be lowercase and uppercase.
  4. Usernames have to be at least two characters long. A two-character username can only use alphabet letters as characters.

Jo - should match

  1. J and o are alpha-numeric
  2. There are 0 numbers at the end
  3. The letter case is fine
  4. The username is two characters, so it must be all letters, which it is

A1 - should not match

  1. A and 1 are alpha-numeric
  2. There is 1 number at the end
  3. The letter case is fine
  4. The username is two characters, so it must be all letters, but it is not

Z97 - should match

  1. Z, 9, and 7 are alpha-numeric
  2. There are 2 numbers at the end
  3. The letter case is fine
  4. The username is three characters, which is fine

the 4) rule states “can only use alphabet letters” NOT alpha-numeric. That’s why it is incorrect

This requirement is why Jo is valid and A1 is invalid. This requirement does not apply to Z97,

I am wrong and I apologize. Z97 is three characters, which confused me.

It’s a tricky challenge (by design). Asking questions and working to understand is part of learning how to turn written requirements into code :slight_smile: