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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((([a-zA-Z\'\.\-]+)?)((,\s*([a-zA-Z]+))?)|([A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})))(;{1}(((([a-zA-Z\'\.\-]+){1})((,\s*([a-zA-Z]+))?))|([A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})){1}))*$
Description
This regular expression matches a series of names and/or email addresses much like you would do in Outlook's To field (e.g. To: [email protected];miles, er;roemer;lagrander, nitra). The first entry must be a name (in the form of last name followed by a comma and first name) or an email address. The following entries are a semicolon followed by one name or email address. The comma and first name are optional components of the name part.
Matches
rohrbach | rohrbach, wi | rohrbach, wi;roemer;[email protected];lagrander, ni
Non-Matches
rohrbach;miles; | rohrbach, wa; | [email protected];miles;;
Author Rating: Not yet rated. William Rohrbach
Source The email address validation portion is based on the email regular expression submitted by bilou mcgyver.
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: Excellent
Name: C Smith
Date: 6/30/2006 3:46:24 PM
Comment:
Serves my needs well :-)


Title: Excellent!
Name: Ben Roberts
Date: 3/8/2005 2:23:15 PM
Comment:
Could anyone out there modify this so that it would only allow valid non-Outlook email structures separated by semi-colons? Apparently, I'm not smart enough!!!! Thanks for the pattern William!


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