So i need a way for python to basically detect the difference between a string that looks like this:
W:1.0,X:1.1(A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5,(F:0.6,G:0.7)H:0.8)Y:0.9
and this:
A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5,(F:0.6,G:0.7)H:0.8
Is there any function that can be used to detect that in the first string, there are 2 inner parenthesis following each other, whereas in the second string, the first inner parenthesis is eventually followed by a closed parenthesis?
It would be best if it is not a .re regular expression.
Thanks!
Edit:
I am dealing with ANY case of parenthesis, anything from:
A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5,(F:0.6,G:0.7)H:0.8,(T:0.6,V:0.7)S:0.8,(D:0.6,Y:0.7)P:0.8,(X:0.6,L:0.7)M:0.8
ANY infinite amount on inner 2 child strings…
To:
W:1.0,X:1.1(U:5.0(I:9.0)N:8.0,(A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5,(F:0.6,G:0.7)H:0.8)R:3.4(O:5.5)P:3.0)Y:0.9
A highly complicated multiple child-fielded string, that can contain any infinite amount of children with their own children
1 Answer