Perl-совместимые регулярные выражения (Perl-compatible regular expressions)
ONIGURUMA SUBROUTINE SYNTAX
For compatibility with Oniguruma, the non-Perl syntax \g followed
by a name or a number enclosed either in angle brackets or single
quotes, is an alternative syntax for referencing a subpattern as
a subroutine, possibly recursively. Here are two of the examples
used above, rewritten using this syntax:
(?<pn> \( ( (?>[^()]+) | \g<pn> )* \) )
(sens|respons)e and \g'1'ibility
PCRE supports an extension to Oniguruma: if a number is preceded
by a plus or a minus sign it is taken as a relative reference.
For example:
(abc)(?i:\g<-1>)
Note that \g{...} (Perl syntax) and \g<...> (Oniguruma syntax)
are not synonymous. The former is a back reference; the latter is
a subroutine call.