I'm not sure about the C# part (I would imagine it would be done using Regex.Replace based on a quick googling), but one regex that would do the trick is this:
Code:\(#[^)]+\)
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:
"SOMETHING (#2)"
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.
I'm not sure about the C# part (I would imagine it would be done using Regex.Replace based on a quick googling), but one regex that would do the trick is this:
Code:\(#[^)]+\)
You can delete the subkey like
rKey = Registry.LocalMachine.OpenSubKey("Software", true);
rKey.DeleteSubKey("AppReg", true);
if you not clear look:
http://net-informations.com/csprj/ov...operations.htm
chris.
Bookmarks