- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Pattern Title
^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+<(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})>$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$
This Works good until we want a multiple email address validator, I am working on it to make it work with the multiple email address, If anyone can work on this part as to validate a multiple email address then that will produce a very good expression, i think the best of this kind. AIM - to Validate Mohit <>; Rohit <>; .........(any number of times)
Mohit <> | Xon <> |
mohit<> | Xon <>, tom <> |,
Author Rating: The rating for this expression. Mohit Yadav
Source Expression Lib and Self improvement
Your Rating
Bad Good

Enter New 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: [^\w\._]+/
Name: aaa
Date: 7/17/2013 11:07:53 PM

Title: Does not match single-character domain names
Name: Marty
Date: 8/8/2012 4:11:33 PM
there are a few single-character domain names (, for example) that do not match.

Title: PS.
Name: Mihnea Stanciu
Date: 4/20/2006 12:50:04 PM
The comment form did not break the lines, so you might get confused by the matches: , DO NOT match since the comma needs to be right after the last letter of the first address, no spaces inbetween.

Title: Multiple addresses
Name: Mihnea Stanciu
Date: 4/20/2006 12:48:03 PM
I've taken your code and adapted it to validate multiple addresses, separated by commas: ^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,5})?(([a-z0-9A-Z_\-\.]+(([\'\.\- ][a-z0-9A-Z_ ])?[a-z0-9A-Z_]*)*\s*<(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,5})>))?(([,.][\s]*([a-z0-9A-Z_\-\.]+(([\'\.\- ][a-z0-9A-Z_ ])?[a-z0-9A-Z_]*)*\s*<(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,5}))>)*([,.][\s]*(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,5}))*)*$ Matches: John <> John <>, John Doe <>,,, John Doe <> Non-matches: <>,, John Doe <>, , John Doe <> Please note: .info addresses are now also valid. You can replace , with ; everywhere in the code at [,.][\s] if you want to separate addresses with semicolons.

Title: Fails to match .info mails
Name: Costinel
Date: 4/21/2005 10:20:40 AM
fails to match a valid mail for .info tld.

Title: Fails to match valid email address
Name: The Fred and Barney Comedy Team <fred&>Fails to match the valid email address
Date: 1/26/2005 3:14:59 AM
Fails to match the valid email address fred&

Copyright © 2001-2015, | ASP.NET Tutorials