validate multiple email addresses in ASP.NET

Bill Johnson 11 Reputation points

Which best way in ASP.NET to validate multiple email address in cc field ?
I'm using this regular expression:

but it's failing.
Example of what I would like to achieve:
email1@Stuff .com; email2@Stuff .com


A set of technologies in the .NET Framework for building web applications and XML web services.
3,362 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Lan Huang-MSFT 27,721 Reputation points Microsoft Vendor

    Hi @Bill Johnson ,
    you can try this:

    ^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25}(($)|( *;+ *$)|( *;+ *(?=[a-zA-Z0-9_\-\.]))))*$  

    This regular expression allows email addresses to be separated by semicolons and spaces, and an optional semicolon is allowed.

    Best regards,
    Lan Huang

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments