As backslashes ('\') are extremely common in regular expressions so JavaScript allows you to quote then in slashes ('/'):
that way every backslash needed in the regex doesn't have to be prefixed with an escape backslash - which is necessary when the regex is inside a JavaScript
string.
In a regex
'.' matches almost every single character'*' indicates a repetition of 0 or more times.'[^0-9]' is a character class. Since it starts with a caret ('^') it is a negated character class and only matches characters that are not specified.
You can quickly experiment with regular expressions on a site like
refiddle.