For validating multiple emails in TextBox, we can use following regular expression. We are separating emails by using delimiter ';'
^((\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)\s*[;]{0,1}\s*)+$
If you want to use delimiter ',' then use this
^((\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)\s*[,]{0,1}\s*)+$
and if you want to use both delimiter ',' and ';' then use this
^((\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)\s*[;,.]{0,1}\s*)+$
So by using above regular expression you can validate single email as well as multiple emails.


Mayur PadhiyarPosted Oct 6, 2016, 4:48 AM EDT
Yes amazing sir but for those who are using it please add regular expression like this: "^((\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*)\\s*[,]{0,1}\\s*)+$" in regular expression otherwise you will get an error something like unrecognised escape sequence regex.Thank you sir for providing such amazing post.
Pradeep ShetPosted Mar 16, 2016, 2:34 AM EDT
Thanks for sharing
Rakesh ParmarPosted Oct 9, 2015, 1:56 AM EDT
nice working single and multiple mail
Krishna PraveenPosted Jun 2, 2015, 1:20 AM EDT
The pattern you had given is working sir but i need for single as well as multiple emial vlaidator pattern can u pls provide me si
Krishna PraveenPosted Jun 2, 2015, 1:19 AM EDT
Hi Sir good afternoon,I saw you pattern for validation an email,can you please provide me the pattern for both single and multiple email validator pattern sir
divyesh patelPosted May 10, 2015, 10:08 PM EDT
not working
Dawood AbbasPosted Nov 17, 2014, 12:31 AM EST
I need regular expression for fax like +(country code)-(area code)-(fax number) for example: +1-212-9876543 and with error message,if miss '-' then show 'missing '-'', if missing '+' then show 'missing '+''.