R

TestRegex

Match nth subpattern

\gn

This matches the text captured in the nth group. n can contain more than one digit, if necessary. This may be useful in order to avoid ambiguity with octal characters.

Examples

PCRE

Share & Embed

Use this snippet to display this token on your own site.

<!-- Embed Regex Token: \gn -->
<code class="regex-token">\gn</code> - Match nth subpattern
<small><a href="https://testregex.com/cheatsheet/match-nth-subpattern-slash-gn">See details</a></small>