Q:

Regexp to capture WHERE clause

this question might look like its easy but to me it's not. Having couple of ddls I want to get their where conditions. So for:
INSERT INTO TABLE_1 (COL_1,
                     COL_2,
                     COL_3)
SELECT 1,2,3 FROM DUAL WHERE (SOME CONDITIONS);

INSERT INTO TABLE_2 (COL_1,
                     COL_2,
                     COL_3)
SELECT 1,2,3 FROM DUAL WHERE
    ONE CONDITION;

INSERT INTO TABLE_3 (COL_1,
                     COL_2,
                     COL_3)
SELECT 1,2,3 FROM DUAL WHERE
    ONE CONDITION OR SECOND CONDITION;

I need to somehow capture: 
(SOME CONDITIONS)
 ONE CONDITION
ONE CONDITION OR SECOND CONDITION;
What I thought would suffice: WHERE(.*\n)*;
But not only that but also a lot of other variations didn't. What do I do wrong?
The tool I'm using to test this is: https://regex101.com/

A:

WHERE[ \r\n]*(.*?);should work fine for you.
It matches everything behind the WHERE with possible not matched whitespaces or newlines until a ; appears, least times possible (the ?)
see example in regex101 here
Also, you may include the s-Flag to include newlines with . (as shown in my example)
Your clause is the first captured group.

