Restrict Possible Usernames | This Answer Passes All But One Test

Tell us what’s happening:
My code passes the test in the console, but not on the FCC test window. It’s frustrating because “RegexGuru” returns “RegexGuru” yet I’m being told it’s not. Can someone tell me what I’m missing.?

Your code so far

let username = "RegexGuru";
let userCheck = /^[A-Z][A-Z]\w*/gi; // Change this line
let result = username.match(userCheck);

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:

Here’s what I am seeing.

You are only supposed to change the line with the comment of “Change this line”. For some reason, you also changed the third line from:

let result = userCheck.test(username);

to this:

let result = userCheck.match(username);

Try to changing match back to test and create an applicable regular expression to solve this challenge.

Hint: Do you need the “g” flag?

Thank you! This worked.