My ESlint throws the error Unexpected control character(s) in regular expression: \x08 no-control-regex for my regular expression let regex = new RegExp("^[0-9a-zA-Z \b]+$");
If i remove \b from my regEx the error is not thrown. Why is this happening? How can i remove the error?
\bin there is perfectly valid (though, how would you get a string that includes the backspace character?)\sshould also match backspace. Actually, I'm not sure backspace is an actual character, and it should be noted that\bis a word boundary, not a character.\byou should probably disable this ESLint rule that is set by default eslint.org/docs/rules/no-control-regex\binside a character class is seen as the backspace character (\x08).how would I get a string that includes the backspace character- did you want a backspace in a string? or do you mean how do you get a backspace into a regexp