Restrict Possible Usernames RegExpression

Tell us what’s happening:

Your code so far


let username = "JackOfAllTrades";
let userCheck = //gi; Change this line
let result = userCheck.test(username);

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames/

What is your question?

What have you tried?

The criteria is Ohhhhhhh should not match the RegEx and above 3 and below 6 should match that. And the regEx i used is /h{3,6}/. But thats wrong.

Ohhhhhh is not part of the test case?

/[A-z][A-z]+\d*/

  1. [A-z]"+" matches the string with at least one letter in it
  2. [A-z][A-z]+ makes it at least two alphabetical character
  3. \d* matches the trailing numbers strings