I have an expression in regex, as follow:
r"(?:AND|OR|SUB|ADD)\([^()]*\)(?:\]\[|\[|)(|\s\[|\s)COIL\(Seq\[\d+]\.Bool\[\d+]\.\d+"
Usually I am using it to capturing from a sentence like that:
AND(Seq[1].Mat)AND(Type_G012.WithData)[COIL(Seq[1].Bool[93].11),XIC(Seq[1].exp)RES(Seq[1].ita)]
So I want to extract the last "AND" or "OR" or "SUB"... also with Seq[1].Bool[93].11. After that I am doing an additional extraction. It was working with no problems with almost everything. The problem is that I have some patterns like that.
AND(Seq[1].Mat)AND(Type_G014.WithData)AND(Type_G015.WithData)[SET(Seq[1].WaitStep)COIL(Seq[1].Seq[93].10),AND(Seq[1].exp)RES(Seq[1].ita)]
Then I am not capturing the last AND, OR, SUB, etc. Because now I have the SET instruction in the middle of the AND and the COIL. So I want to exclude anything diferent of AND|OR|SUB|ADD
Because I would like to extract from the last sentence as follow:
AND(Type_G015.WithData)[SET(Seq[1].Wait)COIL(Seq[1].Seq[93].10
Then is the last AND before the COIL. If something could help me I am testing several things and I am messing it.
Thanks.