This question in not the same as asked before, becouse those patterns do not suit me and it seems they don't work correctly.
I'm trying to create regular expression that helps me to delite all comments from valid C# code. I've almost created it:
(\/\*(.|\n)*?\*\/)|(\/\/\/(.*)|\/\/(.*))
but when I meet something like this:
/* " */ string z = /*"hello"*/"test";
char f2 = '\"'; // symbol " for testing purposes
Console.WriteLine("/*dfsdf*////****/**//**Hello, world!\\");/**/ //
it matches with text in string between quotes. So I need regEx that will match only c# comments but not code(like in string between quotes). I've tried to create it but in vain because my regEx knowledges are too poor.
I would be grateful for any help.
Regards Dmitry