I am using python to try to separate the information from strings of this type:
r = "(-0.04530261550379927+0j) [X0 X1 Y2 Y3]"
ultimately the information that I need is the number in the parenthesis and separate the letters from the numbers in the array. So in the example above, the results that I would like to get are: the number -0.04530261550379927
, an array: [X, X, Y, Y]
and another array: [0, 1, 2, 3]
.
I have been trying with re.match
but since this is the first time that I use this module I find it very confusing.
Would appreciate any help.