Tell us what’s happening:
I cleared this challenge and i was trying different stuff, and i got stuck with this .
Can someone explain to me how is this returning output as true
I don’t understand how the "rnam3" is being passed using this regex.
i purposely dint include the brackets required to complete this challenge.
Your code so far
let username = "BadUs3rnam3";
let userCheck = /^[a-z][a-z]+\d*|\d\d+\d*$/i; // Change this line
let result = userCheck.test(username);
console.log(result)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15.
^[a-z] // checks whether the string starts with a small letter character
[a-z]+ // followed by 1 or more small letter characters
\d* // followed by 0 or more digits
I am sorry if i dint get it right …my basics are not really solid yet, and i am not confident with my given answer to your question.