Andrej Andrej - 1 year ago 192
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, "");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download