开发者

Regular expression for multiple emails in ASP.Net

开发者 https://www.devze.com 2022-12-19 00:16 出处:网络
In my application I validate emails; but we can give more than one email address separated with a semicolon (\";\").How can I write the validation expression?

In my application I validate emails; but we can give more than one email address separated with a semicolon (";"). How can I write the validation expression?

My emails look like this:

"sasidhar@yahoo.com;suryasasidhar@开发者_高级运维gmail.com;srinivas@gmail.com "

How can I write a regular expression for this?


Start with the basic email regex and then apply as follows:

<email regex>(;<email regex>)*


You can give this a try:

\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*

This is from RegexLib.com

0

精彩评论

暂无评论...
验证码 换一张
取 消