Hi I have a problem on which Iam working on which requires me to extract substrings from a string as below:

String A(B(A(C(t=0,p>0.1)))) + D(E(t=1,p>0.1))

Substrings needed are: {A(B(A(C(t=0,p>0.1))))+D(E(t=1,p>0.1)),
A(B(A(C(t=0,p>0.1)))),
B(A(C(t=0,p>0.1))),
A(C(t=0,p>0.1)),
C(t=0,p>0.1),
(t=0,p>0.1),
D(E(t=1,p>0.1)),
E(t=1,p>0.1),
(t=1,p>0.1)}

So in effect i have to be able to get all substrings within the brackets.

How can I do it in C

Please help