I have a regular expression (regex) question...

How would I use regular expressions to remove the contents in parenthesis in a string in C# like this:


The part of the string I want to remove always appears within paranthesis and they are always # followed by some number. The rest of the string needs to be left alone.


string pattern1 = @"\(.*w*\)";
string pattern2= @"\(#\w+\)";

use Regex.Replace, as in

string newstring = rgx.Replace(oldstring, String.Empty);

@complete, have a look at this thread.