R

TestRegex

Match nth relative subpattern

\g{-n}

This matches the text captured in the nth group before the current position in the regex.

Examples

PCRE

Share & Embed

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

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