Yes you're right... I think for this you need to match nested parentheses and such, and Regular expression is not the best tool for that.

http://stackoverflow.com/questions/1...ested-patterns