Email Validation for multiple emails (comma separated)

L

ll

Hi,
I currently am using the following regex in js for email validation,
in which the email addresses can be separated by commas or
semicolons. The problem, however, lies in that I can type two emails
(as a run-on, with no comma or semicolon), and as long as it ends in a
three character domain, it is accepted as valid.

I wonder if there would be a way to make the comma or semicolon
mandatory if a second email address existed?
Many thanks for any help - Louis

Here is the script:

function checkEmailForErrors (Form,Field) {
var emailFilter2=/(([a-zA-Z0-9\-?\.?]+)@(([a-zA-Z0-9\-_]+\.)+)([a-z]
{2,3})(\W?[,;]\W?(?!$))?)+$/i;
var emailValue2=eval("document."+Form+"."+Field+".value");
if (!(emailFilter2.test(emailValue2))) {
return false;
}else{
return true;
}
}
 
G

Georgi Naumov

You can try to use the following regular expression:
/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:(?:[,;][A-Z0-9\._%-]+@[A-
Z0-9\.-]+))?$/i
I not tested it but hope to work good for you.
P.P:
Sorry for my bad english.
Good Luck !
ll :
 
L

ll

You can try to use the following regular expression:
/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:(?:[,;][A-Z0-9\._%-]+@[A-
Z0-9\.-]+))?$/i
I not tested it but hope to work good for you.
P.P:
Sorry for my bad english.
Good Luck !
ll :
Hi,
I currently am using the following regex in js for email validation,
in which the email addresses can be separated by commas or
semicolons. The problem, however, lies in that I can type two emails
(as a run-on, with no comma or semicolon), and as long as it ends in a
three character domain, it is accepted as valid.
I wonder if there would be a way to make the comma or semicolon
mandatory if a second email address existed?
Many thanks for any help - Louis
Here is the script:
function checkEmailForErrors (Form,Field) {
var emailFilter2=/(([a-zA-Z0-9\-?\.?]+)@(([a-zA-Z0-9\-_]+\.)+)([a-z]
{2,3})(\W?[,;]\W?(?!$))?)+$/i;
var emailValue2=eval("document."+Form+"."+Field+".value");
if (!(emailFilter2.test(emailValue2))) {
return false;
}else{
return true;
}
}


Thanks very much for this - I am experimenting with it and will keep
you posted!
Regards,
Louis
 
L

ll

You can try to use the following regular expression:
/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:(?:[,;][A-Z0-9\._%-]+@[A-
Z0-9\.-]+))?$/i
I not tested it but hope to work good for you.
P.P:
Sorry for my bad english.
Good Luck !
ll :
Hi,
I currently am using the following regex in js for email validation,
in which the email addresses can be separated by commas or
semicolons. The problem, however, lies in that I can type two emails
(as a run-on, with no comma or semicolon), and as long as it ends in a
three character domain, it is accepted as valid.
I wonder if there would be a way to make the comma or semicolon
mandatory if a second email address existed?
Many thanks for any help - Louis
Here is the script:
function checkEmailForErrors (Form,Field) {
var emailFilter2=/(([a-zA-Z0-9\-?\.?]+)@(([a-zA-Z0-9\-_]+\.)+)([a-z]
{2,3})(\W?[,;]\W?(?!$))?)+$/i;
var emailValue2=eval("document."+Form+"."+Field+".value");
if (!(emailFilter2.test(emailValue2))) {
return false;
}else{
return true;
}
}

Thanks very much for this - I am experimenting with it and will keep
you posted!
Regards,
Louis



I've tested this, and currently, if I enter more than two email
addresses with the following code, I get the validation error. I
would like to be able to enter as many email addresses as I would like
- how would this be possible? Thanks
Code below:
 
G

Georgi Naumov

Yes.
This is possible. Try pattern in this way:
var emailFilter2=/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:[,;][A-
Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4})*$/i;
Tell me if it working properly.

Best regards.
ll :
You can try to use the following regular expression:
/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:(?:[,;][A-Z0-9\._%-]+@[A-
Z0-9\.-]+))?$/i
I not tested it but hope to work good for you.
P.P:
Sorry for my bad english.
Good Luck !
ll :
Hi,
I currently am using the following regex in js for email validation,
in which the email addresses can be separated by commas or
semicolons. The problem, however, lies in that I can type two emails
(as a run-on, with no comma or semicolon), and as long as it ends in a
three character domain, it is accepted as valid.
I wonder if there would be a way to make the comma or semicolon
mandatory if a second email address existed?
Many thanks for any help - Louis
Here is the script:
function checkEmailForErrors (Form,Field) {
var emailFilter2=/(([a-zA-Z0-9\-?\.?]+)@(([a-zA-Z0-9\-_]+\.)+)([a-z]
{2,3})(\W?[,;]\W?(?!$))?)+$/i;
var emailValue2=eval("document."+Form+"."+Field+".value");
if (!(emailFilter2.test(emailValue2))) {
return false;
}else{
return true;
}
}

Thanks very much for this - I am experimenting with it and will keep
you posted!
Regards,
Louis



I've tested this, and currently, if I enter more than two email
addresses with the following code, I get the validation error. I
would like to be able to enter as many email addresses as I would like
- how would this be possible? Thanks
Code below:
 
L

ll

Yes.
This is possible. Try pattern in this way:
var emailFilter2=/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:[,;][A-
Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4})*$/i;
Tell me if it working properly.

Best regards.
ll :
You can try to use the following regular expression:
/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:(?:[,;][A-Z0-9\._%-]+@[A-
Z0-9\.-]+))?$/i
I not tested it but hope to work good for you.
P.P:
Sorry for my bad english.
Good Luck !
ll :
Hi,
I currently am using the following regex in js for email validation,
in which the email addresses can be separated by commas or
semicolons. The problem, however, lies in that I can type two emails
(as a run-on, with no comma or semicolon), and as long as it ends in a
three character domain, it is accepted as valid.
I wonder if there would be a way to make the comma or semicolon
mandatory if a second email address existed?
Many thanks for any help - Louis
Here is the script:
function checkEmailForErrors (Form,Field) {
var emailFilter2=/(([a-zA-Z0-9\-?\.?]+)@(([a-zA-Z0-9\-_]+\.)+)([a-z]
{2,3})(\W?[,;]\W?(?!$))?)+$/i;
var emailValue2=eval("document."+Form+"."+Field+".value");
if (!(emailFilter2.test(emailValue2))) {
return false;
}else{
return true;
}
}
Thanks very much for this - I am experimenting with it and will keep
you posted!
Regards,
Louis
I've tested this, and currently, if I enter more than two email
addresses with the following code, I get the validation error. I
would like to be able to enter as many email addresses as I would like
- how would this be possible? Thanks
Code below:

Georgi,
Many thanks - this is working very well. I noticed that you removed
the extra "(?:". What did this help to do?
Many thanks,
Louis
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
oglegroups.com>, Fri, 1 Jun 2007 01:01:28, Georgi Naumov
This is possible. Try pattern in this way:
var emailFilter2=/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:[,;][A-
Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4})*$/i;

(A) That rejects at least 2 classes of valid E-mail address. Don't
present E-mail validators unless you are sure that they will accept
anything RFC-compliant.

(B) Your RegExp contains repetition. IMHO, it would be better to split
the string on the set of possible separators and check each part
separately; YMMV. That should help more friendly error reporting, too.

See <URL:http://www.merlyn.demon.co.uk/js-valid.htm>.

<FAQENTRY> E-mail checking is a FAQ.
The most cost-effective answer is "Don't" but a little expansion would
be OK.
 
G

Georgi Naumov

(A) That rejects at least 2 classes of valid E-mail address. Don't
present E-mail validators unless you are sure that they will accept
anything RFC-compliant.
When we made regular expression to respect RFC 822 standart regular
expression
become 6343 characters long. Using this regular expression in actual
applications is
not recommended.
(B) Your RegExp contains repetition. IMHO, it would be better to split
the string on the set of possible separators and check each part
separately; YMMV. That should help more friendly error reporting, too.
May be you are right. May be we can check the differences between
performances
in this two cases.
Here is the RFC compliliant regular expression:
##############################################################################
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r
\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r
\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\
\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\
[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?
[ \t])*))*@(?:(?:\r\n)?[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\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)
(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r
\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r
\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\
\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\
[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?
[ \t])*(?:[^()<>@,;:\\".\[\] \x00-\x1F]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\
["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:
(?:\r\n)?[ \t])*))*)?;\s*)
##############################################################################

Dr J R Stockton :
In comp.lang.javascript message <[email protected]
oglegroups.com>, Fri, 1 Jun 2007 01:01:28, Georgi Naumov
This is possible. Try pattern in this way:
var emailFilter2=/^[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:[,;][A-
Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4})*$/i;

(A) That rejects at least 2 classes of valid E-mail address. Don't
present E-mail validators unless you are sure that they will accept
anything RFC-compliant.

(B) Your RegExp contains repetition. IMHO, it would be better to split
the string on the set of possible separators and check each part
separately; YMMV. That should help more friendly error reporting, too.

See <URL:http://www.merlyn.demon.co.uk/js-valid.htm>.

<FAQENTRY> E-mail checking is a FAQ.
The most cost-effective answer is "Don't" but a little expansion would
be OK.

--
(c) John Stockton, Surrey, UK. [email protected] DOS 3.3, 6.20 ; WinXP.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
 
L

-Lost

Georgi said:
When we made regular expression to respect RFC 822 standart regular
expression
become 6343 characters long. Using this regular expression in actual
applications is
not recommended.
May be you are right. May be we can check the differences between
performances
in this two cases.
Here is the RFC compliliant regular expression:

<snip regular expression>

I get 6,341 characters when I strip 92 newlines. Are you sure 6,343 is
accurate?
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
glegroups.com>, Sat, 2 Jun 2007 12:15:02, Georgi Naumov
When we made regular expression to respect RFC 822 standart regular
expression
become 6343 characters long. Using this regular expression in actual
applications is
not recommended.

There must be better ways of checking for RFC compliance than with a
single RegExp.

Although all working E-mail addresses should be RFC compliant, one
cannot be certain that all actually are. So checking for strict
compliance risks rejecting one that would work.

Checking format cannot indicate whether an E-address is currently
deliverable in the sense that all the software considers it deliverable;
and even if it is in that sense delivered there can be no guarantee that
it is an address that gets read.

The only worthwhile check, IMHO, is whether the string might be an E-
address, rather than empty or something that's been put into the wrong
field. For that, a test for <something>@<something>.<something> will do
- though the form "Fred Q. Smith" <...> should be accepted.
 
L

ll

In comp.lang.javascript message <[email protected]
glegroups.com>, Sat, 2 Jun 2007 12:15:02, Georgi Naumov


There must be better ways of checking for RFC compliance than with a
single RegExp.

Although all working E-mail addresses should be RFC compliant, one
cannot be certain that all actually are. So checking for strict
compliance risks rejecting one that would work.

Checking format cannot indicate whether an E-address is currently
deliverable in the sense that all the software considers it deliverable;
and even if it is in that sense delivered there can be no guarantee that
it is an address that gets read.

The only worthwhile check, IMHO, is whether the string might be an E-
address, rather than empty or something that's been put into the wrong
field. For that, a test for <something>@<something>.<something> will do
- though the form "Fred Q. Smith" <...> should be accepted.

--
(c) John Stockton, Surrey, UK. [email protected] Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.



Thanks everyone,
Appreciate your help in this.
Kind regards,
Louis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top