Reputation: 16854
I going crazry with regex.
I need to extract a words between FROM
and WHERE
in this syntax:
SELECT IDClient, Client FROM Client WHERE IDClient = 1 GROUP BY IDClient, Client ORDER BY IDClient
result = Client
How can I resolve this using regular expressions?
Upvotes: 0
Views: 450
Reputation: 1933
You can use this online regular expression builder:
Or try the tutorials at:
Upvotes: 0
Reputation: 2516
(?<=FROM\s+).*(?=\s+WHERE)
That uses a look behind and a lookahead to get what is between FROM and WHERE, and can be modified depending on whether you want the whitespace or not.
Upvotes: 1