my ultimate goal develop function convert access iif() statements t-sql (2008) case when statments. have vba routine finds iif , matching closing parenthesis if outside of quotes. recursive , finds nested iif() statements without using regex. when narrow down text inside iif parenthesis need identify 2 comma delimiters separate 3 parameters. having trouble when parenthesis inside of quotes. how can setup regex ignore in quotes before processing rest of expression?
i'm trying create expression group find inside single quotes , inside of parenthesis, exclude matches group, , find commas. (please forgive me if i'm not saying correctly since 'capturing group' , 'non-capturing group' give me opposite of expect).
note solution has work vbscript regular expression support same javascript flavor.
condition, true, false <-- string iif parsing function returns before trying split 3 parts.
this expression i've pieced far:
,(?=([^']*'[^']*')*(?![^']*'))(?![^(]*[)])
which works on this:
a=1, nz(b,0), left('xy,z',2)
but these lines more challenging. can't find expression works on of them.
a=1, '1st)', '(2nd)' left(right(a,5),1)='b', '1st)', '(2nd)' a=1, left('a,bc',1) , 'xy,z'
here's regex101 i've been working on:
Comments
Post a Comment