Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "invalid unicode escape in regular expression" occurs when the \c and \u character escapes are not followed by valid characters.

Reference entryJavaScriptFetched
SyntaxError: Invalid regular expression: /\u{123456}/u: Invalid Unicode escape (V8-based)
As listed by MDN Web Docs
SyntaxError: invalid unicode escape in regular expression (Firefox)
As listed by MDN Web Docs
SyntaxError: Invalid regular expression: invalid Unicode code point \u{} escape (Safari)
As listed by MDN Web Docs
Category
SyntaxError
Severity
error
Runtime
both
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: MDN Web Docs. Data fetched 2026-09-25T01:48:37.274Z.