Yeah, it sounds easy but for a RegEx dummy like me it wasn't that easy (thanks Scott). Anyway, I thought that maybe someone some where would find this useful so why not put it on my blog:
//create regex object and intialize with regex validatorRegex r = new Regex(@"[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}");//replace all matching instances of regex validator in string variable 'body' with bracketsstring newText = r.Replace(body, "<>");
I also wanted to point everyone to a nice Regular Expression repository RegExpLib.com (created by Steven Smith) and Dan Applemans excellent Regular Expressions with .NET book.