regex <( )>

Documentation for regex <( )>, assembled from the following types:

language documentation Regexes

From Regexes

(Regexes) regex <( )>

A <( token indicates the start of the match's overall capture, while the corresponding )> token indicates its endpoint. The <( is similar to other languages \K to discard any matches found before the \K.

say 'abc' ~~ / a <( b )> c/;            # OUTPUT: «「b」␤» 
say 'abc' ~~ / <(<( b )> c)>/;        # OUTPUT: «「bc」␤» 

As the example above, you can see <( sets the start point and )> sets the endpoint; since they are actually independent each other, the inner-most start point wins (the one attache to b) and the outer-most end wins (the one attached to c).