Skip to content
JS
JavaScript error

SyntaxError

The JavaScript exception "duplicate capture group name in regular expression" occurs when a regular expression pattern contains two or more named capturing groups with the same name, and these capture groups could be matched at the same time.

Reference entryJavaScriptFetched
SyntaxError: Invalid regular expression: /(?<a>)(?<a>)/: Duplicate capture group name (V8-based)
As listed by MDN Web Docs
SyntaxError: duplicate capture group name in regular expression (Firefox)
As listed by MDN Web Docs
SyntaxError: Invalid regular expression: duplicate group specifier name (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.