Yet more proof that anyone who uses regular expressions to attempt to parse a context-free grammar is in a state of sin.<p>Balanced parentheses form a context-free grammar, and thus cannot be parsed by regular expressions.  There are extensions to regexps which make them irregular — and hence capable of parsing  CFGs — but they often lead to poor performance, as here.