2

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.

0

1 Answer 1

1

You can use

\bwf(?:\.\w+)+(?:\(\))?

See the regex demo. Details:

  • \b - a word boundary
  • wf - a wf string
  • (?:\.\w+)+ - one or more repetitions of a . and one or more word chars (?:\(\))? - an optional occurrence of a () substring.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.