I am used to write regular expression and do understand it however I tried hard to generate regex for below pattern, but finally need help from you guys.
CREATE FUNCTION ...
...
...
BEGIN
DECLARE ...
DECLARE ...
...
END
What I am looking for is to extract 3 groups using Java RegEx:
1st section is from CREATE FUNCITON to BEGIN,
2nd is statements starting with DECLARE and
3rd one is rest everything after DECLARE statements to END.
(See below)
---------------------
CREATE FUNCTION ...
...
...
BEGIN
---------------------
DECLARE ...
DECLARE ...
---------------------
...
END
---------------------