Regular Expressions: Restrict Possible Usernames BadUs3rnam3 c57bT3

Can someone please explain the difference between these? I have 3 different ways of writing the regex for this problem that in my mind should all work, but only one of them works and I don’t understand why.

Your code so far

let username = "BadUs3rnam3"; // should return false.
let userCheck = /[a-z]{2}|^[a-z][a-z]+\d*$|^[a-z]\d{2,}$/i; // returns true.
//let userCheck = /[a-z]{2}|^[a-z]([a-z]+\d*$|\d{2,})$/i; //  returns true.
//let userCheck = /^[a-z]([0-9]{2,}|[a-z]+\d*)$/i; // returns false.
let result = userCheck.test(username);

Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 12739.111.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36.

Challenge: Restrict Possible Usernames
Link to the challenge:

Hello @eligal2001,


Here you are saying “they have two consecutive letters in the string OR”
So they will match BadUs3nam3 and c57bT3, because they have two consecutive letters. You aren’t saying they have only 2 letters.

Thanks! You’re correct, I was under the impression that n{X} meant “only” but it doesn’t.