Regular Expressions Recursion Relative group references


Example

Subpatterns can be referenced with their relative group number:

  • (?-1) will recurse into the previous group
  • (?+1) will recurse into the next group

Also usable with the \g<N> syntax.