How can modify this expression
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
to validate multiple email address separator by comma and/or semicolon
e.g. someone@somedomain.com;someone2@somedomain.com
Jim - 14 Jul 2005 22:42 GMT
Take yourself over to http://www.regexlib.com/
But you should probably heed the warning about email validation!?
http://regexadvice.com/blogs/dneimke/archive/2005/04/01/259.aspx
Jim
> How can modify this expression
> \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
> to validate multiple email address separator by comma and/or semicolon
>
> e.g. someone@somedomain.com;someone2@somedomain.com
"Peter Huang" [MSFT] - 15 Jul 2005 06:29 GMT
Hi
I think you may try to split the string with ; first , and then validate
each one.
Regex.Split Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemTextRegularExpressionsRegexClassSplitTopic3.asp
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
raghavendras@tarangtech.com - 02 Aug 2005 08:37 GMT
Hi you can use the following script:
if( multiEmail() )
document.PdfEmailForm.submit();
function multiEmail()
{
var str=document.PdfEmailForm.to.value;
var email = str.split(',');
for (var i = 0; i < email.length; i++)
{
if(!checkemail(email[i]))
{
alert('one or more
email addresses are not
valied');
return false;
}
}
return true;
}
function checkemail(email)
{
var str=document.PdfEmailForm.from.value;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str) && filter.test(email))
return (true)
else
return(false)
}
where :
document.PdfEmailForm.to.value - E-mail ids what we enter in TO field.
document.PdfEmailForm.from.value - E-mail ids what we enter in TO field.
Alvin Bruney [Microsoft MVP] - 02 Aug 2005 18:08 GMT
another good place for regex stuff is regexlib.com

Signature
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc, Amazon, B&H etc
-------------------------------------------------------------------------------
> Hi you can use the following script:
>
[quoted text clipped - 43 lines]
> Comprehensive, categorised, searchable collection of links to ASP &
> ASP.NET resources...