I have a lot of code and would like to find and replace some text in it. I want to replace all matches, but excluding those that are in comments. Suppose I want to find and replace string "text" in my code. Example:
Console.WriteLine("text"); // must be replaced
// some text /* does not need to be replaced because this string begins from "//" */
Unfortunately, I don't know how to do it with regular expressions. Could someone help me?