A backslash makes a regex metacharacter match literally. For example, /\\/ matches a backslash; without escaping, special characters such as ^, $, ., and * have regex meaning. section 12.2.2
Regex literals and strings
In a JavaScript regex literal, write /\\/ to match a backslash. The equivalent constructor is new RegExp("\\\\"): string literals also use backslash escapes, so the backslashes must be doubled. section 12.2.2
ESLint’s no-invalid-regexp rule can help catch invalid special-character usage that would otherwise cause a runtime error. section 12.2.2
