﻿# Matches content in parenthesis, as long as it is balanced
\(                  # An open parenthesis
(?>                 # Followed by...
    [^\(\)]+|       # any number of non-parenthesis character OR
    \((?<Depth>)|   # an open parenthesis (in which case increment depth) OR
    \)(?<-Depth>)   # a closed parenthesis (in which case decrement depth)
)*(?(Depth)(?!))    # until depth is 0.
\)                  # followed by a closing parenthesis