Andrej Andrej - 11 months ago 85
C# Question

regular expression needed to remove C/C# comments

I need a C# regex to delete everything between

including the
So, basically remove all code comments in the given text.

Answer Source

Should be something like this:

var regex = new Regex("/\*((?!\*/).)*\*/", RegexOptions.Singleline);

regex.Replace(input, "");