| I think this is best done with a stack rather than regular expressions, because regexes break down on arbitrarily nestable structures. So basically everytime you see a open paren, push onto a stack and whenever you see a close paren, pop stuff off the stack and when the stack is empty you'll have the outermost parenthetical expression.
__________________ Stop intellectual property from infringing on me
Last edited by teknomage1; 01-19-2006 at 11:35 PM.
|