Posted By

mamoo on 10/17/08


Tagged

regex email c


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

robe
umang_nine
khouser
tonicglop


Validate email list through Regex


 / Published in: C#
 

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

  1. Regex matchRegex = new Regex(@"[a-zA-Z0-9_\-\.][email protected][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. }

Report this snippet  

You need to login to post a comment.