Title |
Test
Find
Pattern Title
|
Expression |
|
Description |
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 <[email protected]>; Rohit <[email protected]>; .........(any number of times) |
Matches |
|
Non-Matches |
|
Author |
Rating:
Mohit Yadav
|
Source |
Expression Lib and Self improvement |
Your Rating |
|
Title: [^\w\._]+/
Name: aaa
Date: 7/17/2013 11:07:53 PM
Comment:
a
Title: Does not match single-character domain names
Name: Marty
Date: 8/8/2012 4:11:33 PM
Comment:
there are a few single-character domain names (@q.com, for example) that do not match.
Title: PS.
Name: Mihnea Stanciu
Date: 4/20/2006 12:50:04 PM
Comment:
The comment form did not break the lines, so you might get confused by the matches: [email protected] , [email protected] 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
Comment:
I've taken your code and adapted it to validate multiple addresses, separated by commas:
^(\w[-._\w]*\[email protected]\w[-._\w]*\w\.\w{2,5})?(([a-z0-9A-Z_\-\.]+(([\'\.\- ][a-z0-9A-Z_ ])?[a-z0-9A-Z_]*)*\s*<(\w[-._\w]*\[email protected]\w[-._\w]*\w\.\w{2,5})>))?(([,.][\s]*([a-z0-9A-Z_\-\.]+(([\'\.\- ][a-z0-9A-Z_ ])?[a-z0-9A-Z_]*)*\s*<(\w[-._\w]*\[email protected]\w[-._\w]*\w\.\w{2,5}))>)*([,.][\s]*(\w[-._\w]*\[email protected]\w[-._\w]*\w\.\w{2,5}))*)*$
Matches:
John <[email protected]>
[email protected]
John <[email protected]>, John Doe <[email protected]>, [email protected]
[email protected],[email protected], John Doe <[email protected]>
Non-matches:
<[email protected]>
[email protected]
[email protected], [email protected], John Doe <[email protected]>,
[email protected] , John Doe <[email protected]>
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
Comment:
fails to match a valid mail for .info tld.
Title: Fails to match valid email address
Name: The Fred and Barney Comedy Team <fred&[email protected]>Fails to match the valid email address
Date: 1/26/2005 3:14:59 AM
Comment:
Fails to match the valid email address
fred&[email protected]