Feature: Backreferences
Home | Features | Improve this section
Backreferences allow a pattern to re-match a previously matched capture group1 2 either by number (n) or by name.
Syntax
NOTE: The following syntax is an example based on some of the supported engines. For specific engine support, see Engines.
\n
— Where n is a decimal digit in the range 1-9. Matches the same string as the capture group n.\k<name>
— Matches the same string as the named capture group with the name name.
Engines
Engine | Supported |
---|---|
Perl | ✔ |
PCRE | ✔ |
Boost.Regex | ✔ |
.NET | ✔ |
Oniguruma | ✔ |
Hyperscan | ❌ |
ICU | ✔ |
Glib/GRegex | ✔ |
ECMAScript | ✔ |