in reply to Re: Text::Balanced with nested / custom bracketsin thread Text::Balanced with nested / custom brackets
$re = qr{ \( (?: (?> [^()]+ ) # Non-parens without backtracking | (??{ $re }) # Group with matching parens )* \) }x; [download]