I\'m looking for a regular expression which will perform the following:
INPUT: User Name (email@address.com) OUTPUT: User Name
What would b
This should do the job:
var input = "User Name (email@address.com)"; var output = Regex.Replace(input, @" ?\(.*?\)", string.Empty);
Note the escaping of the ( and ) chars so that they aren't recognised as group markers.
(
)