Posted By

ezerick on 03/29/12


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

rcraven
kzelda
Priestd09


Email Address regex in C#


 / Published in: C#
 

URL: http://snipplr.com/login/

finds all of the alid email addresses in a string

  1. //using System.RegularExpressions
  2.  
  3. MatchCollection EmailMatches = Regex.Matches(txtEmailAddress.Text,"([\\w-+\\.]+)@((?:[\\w]+\\.)+)([a-zA-Z]{2,4})",RegexOptions.Multiline);
  4. Response.Write(EmailMatches.Count);

Report this snippet  

You need to login to post a comment.