Possible Duplicate:
Regular Expression to match outer brackets
I have a string of the following format:
(((aaa (bbb) ccc)(ddd (eee) fff) ggg)(hhh (iii) )(jjj (kkk) lll) mmm)(nnn (ooo) ppp)(qqq (rrr) sss)
It basically has 3 main parts:
(((aaa (bbb) ccc)(ddd (eee) fff) ggg)(hhh (iii) )(jjj (kkk) lll) mmm)
(nnn (ooo) ppp)
(qqq (rrr) sss)
I need the search expression to get the 3 parts in an array (ignoring any sub parentheses). Once that is done, I need another search expression to split the individual parts (only 2nd & 3rd):
(nnn (ooo) ppp) => nnn,ooo,ppp
Thanks