i want to extract the comments out of a string as a block.
e.g. I have a PL/SQL code as:
--comment1 select * from t_table; --i want comment 2; /*i want comment 3 */ --i want comment 4 OPEN data_cur;
Here, i want all the single line and multiline comments before OPEN data_cur; but after
select * from t_table;
i.e. i want a full comment block between two PL/SQL statements.
i want the regex to match the string and form the groups as:
- SQL statement
- whole comment block
Can it be done using any regex?