Title |
Test
Find
Email Validation
|
Expression |
^([a-zA-Z0-9]+([\.+_-][a-zA-Z0-9]+)*)@(([a-zA-Z0-9]+((\.|[-]{1,2})[a-zA-Z0-9]+)*)\.[a-zA-Z]{2,6})$ |
Description |
This pattern was based on this reference: http://www.remote.org/jochen/mail/info/chars.html
This expression allows only these symbols (+, -, _, or .) in the local part of the address, but no two consecutive symbols are allowed. The symbols behave like separators for alphanumeric atoms. The local part must begin and end with an atom. Therefore, local part cannot begin or end with a symbol.
For the domain name, I tested what was allowed at various domain registrars. While hyphens are allowed, domain names must abide by the following rules:
-can't begin or end with hyphen
-no more than two hyphens can appear consecutively |
Matches |
|
Non-Matches |
|
Author |
Rating:
Chin Bae
|
Source |
|
Your Rating |
|
Title: To Randal L. Schwartz
Name: Bryan Johnson
Date: 11/10/2010 8:16:44 PM
Comment:
Wow! You're kind of a douchebag. Actually, you're a supreme douchebag. This regular expression works great and probably meets about 99% of all use cases. The expression that you link is a freaking joke and probably takes about 500 milliseconds to evaluate a single address.
Title: To Randal L. Schwartz
Name: Bryan Johnson
Date: 11/10/2010 8:16:10 PM
Comment:
Wow! You're kind of a douchebag. Actually, you're a supreme douchebag. This regular expression works great and probably meets about 99% of all use cases. The expression that you link is a freaking joke and probably takes about 500 milliseconds to evaluate a single address.
Title: To Randal L. Schwartz
Name: Bryan Johnson
Date: 11/10/2010 8:16:01 PM
Comment:
Wow! You're kind of a douchebag. Actually, you're a supreme douchebag. This regular expression works great and probably meets about 99% of all use cases. The expression that you link is a freaking joke and probably takes about 500 milliseconds to evaluate a single address.
Title: WRONG WRONG WRONG
Name: Randal L. Schwartz
Date: 2/27/2008 5:12:46 PM
Comment:
The minimum regex that can validate an ACTUAL email address is at http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html Please go read that, and then know why I'm laughing at yours.