Basically, my goal is to remove everything inside ()'s except for strings that are inside "".
I was following the code here: Remove text in-between delimiters in a string (using a regex?)
And that works great; but I have the additional requirement of not removing ()s if they are in "". Is that something that can be done with a regular expression. I feel like I'm dangerously close to needing another approach like a true parser.
This is the what I've been using....
string RemoveBetween(string s, char begin, char end)
{
Regex regex = new Regex(string.Format("\\{0}.*?\\{1}", begin, end));
return regex.Replace(s, string.Empty);
}