2

What will be regular expression to validate email address so that multiple Email should not be entered comma separated, it should be semi colon separated . Is below mentioned expression is valid?

function validateEmail($email) {
                var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
                return emailReg.test($email);

This Regular expression is also validating Email that are comma separated. What I want is that For example : john1@gmail.com,john2@gmail.com this string is entered by user than error will reflect.

But it should validate successfully to this: john1@gmail.com;john2@gmail.com

Raj
  • 183
  • 3
  • 17
  • Your question is: "Is below mentioned expression is valid?" Well, test it with a online regex tool. – arkascha Dec 09 '16 at 11:14
  • Possible duplicate of [semicolon separated email validation in javascript only](http://stackoverflow.com/questions/30860412/semicolon-separated-email-validation-in-javascript-only) – Douwe de Haan Dec 09 '16 at 11:22
  • @DouwedeHaan .I have updated my question. Can you please assist for the same. – Raj Dec 09 '16 at 13:05

0 Answers0