Regular Expressions Recursion Recurse the whole pattern


Example

The construct (?R) is equivalent to (?0) (or \g<0>) - it lets you recurse the whole pattern:

<(?>[^<>]+|(?R))+>

This will match properly balanced angle brackets with any text in-between the brackets, like <a<b>c<d>e>.