RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*
Description
Validates 1 or more email addresses. Email addresses can be delimited with either comma or semicolon. White space is allowed after delimiter, but not necessary. I needed this to allow my users to specify multiple email addresses if they choose to do so.
Matches
lewis@moten.com | lewis@moten.com, me@lewismoten.com | lewis@moten.com;me@lewismoten.com
Non-Matches
lewis@@moten.com
Author Rating: The rating for this expression. Lewis Moten
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Thanks!
Name: DennisF6
Date: 12/9/2010 5:30:49 PM
Comment:
Almost exactly what I needed. I just needed to add an apostrophe character in the [-+.] area (becomes [-+.'] )to cover addresses like brian.o'ryan@company.com.


Title: Thanks!
Name: DennisF6
Date: 12/9/2010 5:30:32 PM
Comment:
Almost exactly what I needed. I just needed to add an apostrophe character in the [-+.] area (becomes [-+.'] )to cover addresses like brian.o'ryan@company.com.


Title: Optimization of regex
Name: Elvis Furtado
Date: 5/17/2010 3:07:34 AM
Comment:
Hi Lewis, I was going through your regex and I felt as if the second section wherein you have repeated the entire email regex along with space checks, could be done without it. I have added a similar regex on http://regexlib.com/REDetails.aspx?regexp_id=3029. Can you have a look and let me know if it is better optimized? and if not then how I can improve it? Thanking in anticipation, Elvis


Title: Matches Invalid Email address
Name: Some developer
Date: 8/26/2005 11:24:13 AM
Comment:
It's a nice reg ex but it matches this as a valid email address: "b cause.I.can@bogus.email.com"


Title: Fails to match valid email address
Name: The Fred and Barney Comedy Team <fred&barney@stonehenge.com>
Date: 1/26/2005 3:12:31 AM
Comment:
Fails to match the valid email address fred&barney@stonehenge.com


Title: Trailing ; in ASP.NET
Name: Bruno
Date: 11/10/2004 6:34:40 PM
Comment:
I am using it in validation control (ASP>NET), but it seems that the validator doesn't like the trailing ; character at the end of the list... Tks.


Title: Oops
Name: John Wells
Date: 9/16/2004 11:18:42 AM
Comment:
Does not match e-mails with -'s such as First.Last.-XX@domain.com Such a convention is a legal email addy


Title: Fails
Name: Chris Hester
Date: 8/3/2004 11:05:23 AM
Comment:
The address ".a@b.com" is matched. I think that is wrong.


Title: Match fails - Correction
Name: Josef
Date: 7/16/2004 3:36:06 PM
Comment:
Ops, sorry, I mean foo..foo@foo.com matches, but it's an invalid address


Title: Match fails
Name: Josef
Date: 7/16/2004 3:35:00 PM
Comment:
Doesn't work with: foo..foo@foo.com


Copyright © 2001-2014, RegexAdvice.com | ASP.NET Tutorials