Tell us what’s happening:
Pretty confident my regEx should work. From my repl I’ve tried the following code.
let regex = /^[a-zA-Z]{2,}[\d]*$/;
let term = ‘JACK’;
let ans = regex.test(term);
console.log(ans);
And it matches fine. Yet from the lesson it isn’t passing.
Your code so far
let username = "JackOfAllTrades";
let userCheck = /^[a-z A-Z]{2,}[\d]*$/ig; // Change this line
let result = userCheck.test(username);
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 11151.113.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.127 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames/