A simple question but I can't find the answer.
I'm scanning a huge pile of mails and would like to get rid of anything between () in the email adresses since this normally contains just info that varies over time.
As a delimiter I use the ; between the email addresses.
So this is basically the only character not allowed between ().

This uses another version of StringReplace similar to Mr. Wizard's but not using Shortest. The StringSplit is what uses ; to identify separate email names.

The StringTrim is only added here to remove white space.

From the fact that you accepted Mr.Wizard's answer I understand that you wish for the replacement to fail when there is a ; between the ( ...). I've "upgraded" my solution to satisfy this strange requirement.

It is also more flexible than using shortest.
–
JensJun 18 '12 at 19:19

Yes it is a strange requirement. But I found a very limited use (2 out of 441 addresses) of the ; sign to denote an email address Like Me, To (strange@mail; blah blah). Perhaps I should just ignore these mail addresses but they do occur also in other mails so to correlate them.. Perhaps it's to far fetched.. Thx
–
LouJun 18 '12 at 19:34

"As of Version 6.0, ShortestMatch has been superseded by the pattern object Shortest." :-)
–
Mr.Wizard♦Jun 18 '12 at 18:43

@Mr.Wizard Is this true for strings as well?
–
Leonid ShifrinJun 18 '12 at 18:44

I'm fairly certain it is. Isn't that the new paradigm?
–
Mr.Wizard♦Jun 18 '12 at 18:47

@Mr.Wizard Somehow I always felt that ShortestMatch is for strings only, and works differently (and most likely much faster) than Shortest for patterns, because string patterns are generally much faster than Mathematica patterns when used in string-processing built-in functions.
–
Leonid ShifrinJun 18 '12 at 18:57

I believe it is just internally overloaded; if used for strings it switches. I only performed one test but I'm not seeing an efficiency difference.
–
Mr.Wizard♦Jun 18 '12 at 19:18

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.