My string looks like this:
string = "*[EQ](@[Type],'A,B,C',@[Type],*[EQ](@[Type],D,E,F))"
The ideal output list is:
['@[Type]', 'A,B,C', '@[Type]', '*[EQ](@[Type],D,E,F)']
So I can parse the string as:
if @[Type] in ('A,B,C') then @[Type] else *[EQ](@[Type],D,E,F)
The challenge is to find all the commas followed by @, ' or *. I've tried the following code but it doesn't work:
interM = re.search(r"\*\[EQ\]\((.+)(?=,@|,\*|,\')+,(.+)\)", string)
print(interM.groups())
Edit:
The ultimate goal is to parse out the 4 components of the input string:
*[EQ](Value, Target, ifTrue, ifFalse)