OK,
I don’t know if it is possible to write this regex, so I am going to start by askign for help – so far I have had no success.
source string:
,convert(varchar(8000), lt.text) as reason
desired match:
convert(varchar(8000), lt.text)
assumptions
- statement starts with a comma (outside of the parens)
- state will end with “as “
this is the regex i am starting with:
\(.+\)
Thank you
Bar Kiers – is correct, the inability to cope “with an arbitrary amount of nesting”, is the root cause of both my memory as to why and the reason as to why I couldn’t accomplish what I wanted.
HACK ALERT: I solved by grabbing the inner most instance and replacing it out with a placeholder, and then processing recursively until there were no more matches…