let str = '7hello';
let strRegex = /^[a-z]/;
let outcome = str.match(strRegex);
When I run this in repl.it the output is null, but isn’t that wrong? I wanted to check to see if the beginning of the string had something other than a letter. I expected ‘7’.
in that way the caret is an anchor, it matches the start of a string
if you want to negate character class you need to put the caret inside the character class, like
if you want both (negate character class and math beginning of string) you need to use the caret in both places