Match 1
characters 0–6Ada 37Ada37AdaPaste a JavaScript regular expression and test text to inspect exactly what each capture group contains. See full matches, numbered captures, named groups, and character ranges without sending your input to a server.
Try flags such as g, i, m, s, or u. With no g or y, JavaScript returns only the first match.
Ada 37Ada37AdaLinus 55Linus55LinusGrace 85Grace85GraceParentheses such as (\\d+) create numbered captures in left-to-right opening-parenthesis order. JavaScript named groups use (?<name>...), which lets application code read match.groups.name instead of relying only on a numeric position.
/(?<year>\d{4})-(\d{2})-(\d{2})/
// full match: 2026-08-17
// $1 / year: 2026
// $2: 08
// $3: 17Use (?:...) when parentheses exist only to control precedence or apply a quantifier. Non-capturing groups keep the result easier to reason about and prevent later edits from unexpectedly shifting numbered group positions.
If a pattern is difficult to understand even with this explorer, move to the Regex Debugger or test the full expression in the Regex Tester.
A group inside ? or an unmatched alternative may legitimately be undefined for a particular match.
Nested capturing parentheses still consume group numbers. Convert structure-only parentheses to (?:...) when captures are not needed.
The g flag returns repeated matches. Each match has its own capture values, so inspect groups per match rather than assuming one global value.
A capture group is a parenthesized part of a regular expression whose matched text is stored separately from the full match. Numbered groups use parentheses such as (\d+), while named groups use syntax such as (?<year>\d{4}) in JavaScript.
A capturing group stores its matched substring for later inspection or backreferences. A non-capturing group, written (?:...), groups alternatives or quantifiers without creating a numbered capture.
Optional groups and alternatives do not have to participate in every match. When a group does not participate, JavaScript returns undefined for that capture.
Yes. Patterns are evaluated with the browser JavaScript RegExp engine, so group syntax, flags, lookbehind support, Unicode behavior, and backreferences follow ECMAScript semantics.
Move from a live JavaScript regex test to capture-group inspection, flag behavior, literal escaping, focused pattern references, and debugging guides without treating each regex task as an isolated page.