I'm trying to find a regex which can be used to match SQL style comments. Single line comments was fairly easy --.* however I can't work out how to match multi line comments. I don't need the actual replacement code just the regex to match the comments.
For instance:
select * from valid_sql1;
select * from valid_sql2; --comment here
--comment select * from this_is_still_a_comment;
/*
select * from this_is_not_valid;
*/
/*comment*/ select * from valid_sql3; /*this is a comment*/
Should become:
select * from valid_sql1;
select * from valid_sql2;
select * from valid_sql3;
Any help is greatly appreciated.