Get to know MDN better
The JavaScript exception "raw bracket is not allowed in regular expression with unicode flag" occurs when a Unicode-aware regular expression pattern contains a raw bracket ({, }, ]) that is not part of a quantifier or character class.
In Unicode-unaware mode, {, }, and ] that are not part of a quantifier or character class are treated as literal characters. This may hide errors in your code and is therefore deprecated and disallowed in Unicode-aware mode. You should either check whether you have invalid syntax or you should escape the characters to match them literally.
If { appears in a context that accepts a quantifier, it is treated as the start of a quantifier. If what follows it is not a valid quantifier, another syntax error, incomplete quantifier, is thrown.
This page was last modified on Jul 8, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.