Be careful that comments can be nested. If comments can be nested, like in SQL, the main regex will look like this:
/\*.*?\*/
You will need a loop until you lose nothing.
If, on the contrary, comments end in the first * /, as in C, you need to be greedy with a negative look:
/\*((?!\*/).)*\*/
source share