I am trying to test a Regex which should be able to split the following expressions into 3 parts:
- test
- true
- false
If there are multiple iif
nested, it should give me multiple matches
And I have some patterns:
iif(testExpression, trueExpression, falseExpression)
iif((@HasMinimunRegulatedCAR@==0),(([t219]>1.5) OR ([t219]<-0.5)),(([t223]>1.5) OR ([t223]<-0.5)))
iif((@HasMinimunRegulatedCAR@==1), iif((@MFIUsePAR30@==1), ([t224]>0.25), iif((@MFIUsePAR90@==1), ([t225]>0.25), (1==1))), iif((@MFIUsePAR30@==1), ([t220]>0.25), iif((@MFIUsePAR90@==1), ([t221]>0.25),(1==1))))
I am using this expression but it doesn't work when I have multiple iif
nested
(^(iif\()|[^,]+)
I am running my tests using: https://regex101.com/
The expected output should be
testExpression
trueExpression
falseExpression
(@HasMinimunRegulatedCAR@==0)
([t219]>1.5) OR ([t219]<-0.5)
([t223]>1.5) OR ([t223]<-0.5)
(@HasMinimunRegulatedCAR@==1)
iif((@MFIUsePAR30@==1), ([t224]>0.25), iif((@MFIUsePAR90@==1), ([t225]>0.25), (1==1)))
iif((@MFIUsePAR30@==1), ([t220]>0.25), iif((@MFIUsePAR90@==1), ([t221]>0.25),(1==1)))