counted capture groups: (?^msx: ((?^msx: \( ([^()]* | (??{ our $rx }))* \) )) [^()]* ((?^msx: \( ([^()]* | (??{ our $rx }))* \) )) ) | | | | | | | | 1st begin 2nd begin 2-end 1st end 3rd begin 4th begin 4-end 3rd end