Reply
Old July 12th, 2011 Top | #1
 
Complete's Avatar
OSNN Addict
Joined: August 2005
Posts: 94
Reputation: 10
Power: 83

Default I have a regular expression question...

I have a regular expression question...
How would I use regular expressions to remove the contents in parenthesis in a string in C# like this:
"SOMETHING (#2)"
Complete is offline   Reply With Quote
Old July 12th, 2011 Top | #2
 
Complete's Avatar
OSNN Addict
Joined: August 2005
Posts: 94
Reputation: 10
Power: 83

Default Re: I have a regular expression question...

According to:

Regex Class (System.Text.RegularExpressions)

I have gotten some results like this:
string pattern = @"\(#\d+\)";
Regex rgx = newRegex(pattern, RegexOptions.IgnoreCase);
MatchCollection matches = rgx.Matches(interesting_string);

But I do not know what to do with the matches or what to do after this.
Complete is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular expression generator LordOfLA Web Design & Coding 0 June 24th, 2009 6:02pm
Merging Expression Web with Office 2007? Eiji Windows Applications 1 July 12th, 2008 9:44pm
Microsoft Expression Line kcnychief Web Design & Coding 6 February 8th, 2007 10:48pm
Microsoft to launch Expression Studio in 2007 deboz Web Design & Coding 10 December 6th, 2006 1:01am
Microsoft Expression Web Beta 1 kcnychief Windows Desktop Systems 6 September 11th, 2006 7:02pm