Validate email list through Regex


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



Copy this code and paste it in your HTML
  1. Regex matchRegex = new Regex(@"[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9_\-\.]+\.[a-zA-Z]{2,5}");
  2. MatchCollection matches =
  3. if ( matches.Count > 0)
  4. {
  5. for ( int i = 0; i <>
  6. {
  7. // You can process the email matched
  8. // for example you can check if it's a real email address or not.
  9. // by pinging the mail provider.
  10. ProcessEmailAddress(matches[i].Value);
  11. }
  12. }

URL: http://cairocafe.blogspot.com/2006/05/regex-validating-csv-email-addresses.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.