Tell us what’s happening:
I am happy that my code passed your tests, however I want to know why on this testing site its showing what I believe to be the opposite for some cases.
Your code so far
let username = "JackOfAllTrades";
let userCheck = /[^0-9]\w/ig; // Change this line
let result = userCheck.test(username);
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36.
Link to the challenge:
Your code is too generic to be really useful in really doing that check, but st the same time the tests can’t check all usercases, so there are various regex that pass the tests even if they are not doing what the tests ask them to do - maybe it will be changed eventually. Your code for example match
"A6B5C", but this is not valid for the instructions of the challenge: Your code is matching one not-number character followed by a word character (
\w is equal to [0-9a-zA-Z_]). No limitantions on number of characters, beginning or end of string etc
An other thing you shouldn’t do is to use the
g flag for the test method, it has a particular behaviour and if you don’t know that behaviour don’t use the