Regular Expressions - Restrict Possible Usernames

Tell us what’s happening:
I think my solution can pass the test, but why still me " Failed:Your regex should not match the string BadUs3rnam3".

Your code so far

let username = "JackOfAllTrades";
let userCheck = /^[a-z]{2,}|^[a-z][0-9]{2,}$/i; // Change this line
let result = userCheck.test(username);
console.log("BadUs3rnam3".match(/^[a-z]{2,}|^[a-z][0-9]{2,}$/i));

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36

Challenge: Regular Expressions - Restrict Possible Usernames

Link to the challenge:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.