Email Address regex in C#


/ Published in: C#
Save to your folder(s)

finds all of the alid email addresses in a string


Copy this code and paste it in your HTML
  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);

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.