regex over multiple lines in Groovy

Viewed 27550

I have a multiple line string like following:

END IF;

EXECUTE IMMEDIATE ' CREATE INDEX #idx1
      ON somename ( row_id,
                           something)';
   IF v_sys_error  0 THEN
      GOTO SQL_ERROR;

   END IF;

I wish to capture the part in bold (meaning everything from EXECUTE IMMEDIATE to next semicolon.

I have the following regex but how can I change it to work with multiple lines?

(EXECUTE).*;
3 Answers
Related