I have a regexp that selects the columns from SQL query: \bwf\.[^,|^\s|^)]*
So from both queries
SELECT (wf.Name,
wf.Status)
SELECT wf.Name, wf.Status
it will return "wf.Name", "wf.Status". But also I want to cover case when column contains round brackets:
SELECT (wf.Name,
wf.Status())
regexp should return "wf.Name", "wf.Status()".
I tried to do it through non-capturing group (?:(?!\s|,|<statement>).)* but without success.