Displaying page
of
pages;
Items to
Title |
Test
Details
email address (RFC 2822 mailbox)
|
Expression |
^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$ |
Description |
This accepts RFC 2822 email addresses in the form:<br>
[email protected] OR<br>
Blah < [email protected]><br>
<br>
RFC 2822 email 'mailbox':<br>
mailbox = name-addr | addr-spec<br>
name-addr = [display-name] "<" addr-spec ">"<br>
addr-spec = local-part "@" domain<br>
domain = rfc2821domain | rfc2821domain-literal<br>
<br>
local-part conforms to RFC 2822.<br>
<br>
domain is either:<br>
An rfc 2821 domain (EXCEPT that the final sub-domain must consist of 2 or more letters only).<br>
OR<br>
An rfc 2821 address-literal.<br>
(Note, no attempt is made to fully validate an IPv6 address-literal.)<br>
<br>
Notes:<br>
This pattern uses (.NET/Perl only?) features named group "(?<name>)" and alternation/IF (?(name)).<br>
<br>
See <a href="http://regexadvice.com/forums/permalink/26742/26742/ShowThread.aspx#26742">this regexadvice.com thread</a> for more info, including a version that does not use .NET features.<br>
<br>
RFC 2822 (and 822) do allow embedded comments, whitespace, and newlines within *some* parts of an email address, but this pattern above DOES NOT.<br>
<br>
RFC 2822 (and 822) allow the domain to be a simple domain with NO ".", but this pattern requires a compound domain at least one "." in the domain name, as per RFC 2821 (4.1.2).<br>
<br>
RFC 2822 allows/disallows certain whitespace characters in parts of an email address, such as TAB, CR, LF BUT the pattern above does NOT test for these, and assumes that they are not present in the string (on the basis that these characters are hard to enter into an edit box). |
Matches |
|
Non-Matches |
|
Author |
Rating:
Mark Cranness
|
Title |
Test
Details
RFC 2822 Date Regex
|
Expression |
^(?:\s*(Sun|Mon|Tue|Wed|Thu|Fri|Sat),\s*)?(0?[1-9]|[1-2][0-9]|3[01])\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(19[0-9]{2}|[2-9][0-9]{3}|[0-9]{2})\s+(2[0-3]|[0-1][0-9]):([0-5][0-9])(?::(60|[0-5][0-9]))?\s+([-\+][0-9]{2}[0-5][0-9]|(?:UT|GMT|(?:E|C|M|P)(?:ST|DT)|[A-IK-Z]))(\s*\((\\\(|\\\)|(?<=[^\\])\((?<C>)|(?<=[^\\])\)(?<-C>)|[^\(\)]*)*(?(C)(?!))\))*\s*$ |
Description |
This is the best RFC 2822 ( http://www.faqs.org/rfcs/rfc2822 ) date format regular expression I could come up with. I've tested it, not very extensively though. This regex also validates obsolete standard, excluding comments anywhere. |
Matches |
Thu, 6 Jan 2005 18:44:56 -0500 | Thu, 21 Dec 2000 16:01:07 +0200 (\(proper\) & (nested) comment) |
Non-Matches |
Thu, 0 Jan 1856 18: 44:56 -0500 | Thu, 21 Dec 2000 16:01:07 +0200 (\(improper) comment) | blah |
Author |
Rating:
Ivik Injerd
|
Title |
Test
Details
Almost RFC2822 Compliant Email Address Check
|
Expression |
^(?:(?#local-part)(?#quoted)"[^\"]*"|(?#non-quoted)[a-z0-9&+_-](?:\.?[a-z0-9&+_-]+)*)@(?:(?#domain)(?#domain-name)[a-z0-9](?:[a-z0-9-]*[a-z0-9])*(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])*)*|(?#ip)(\[)?(?:[01]?\d?\d|2[0-4]\d|25[0-5])(?:\.(?:[01]?\d?\d|2[0-4]\d|25[0-5])){3}(?(1)\]|))$ |
Description |
Validates an RFC 2822 email address, except does not allow most punctuation and non-ascii alphanumeric characters. Also does not take length requirements into account. Allows domain name and IP addresses, but ensures that the IP address entered is valid. |
Matches |
|
Non-Matches |
|
Author |
Rating:
Daniel
|
Title |
Test
Details
Email validation
|
Expression |
^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.(af|ax|al|dz|as|ad|ao|ai|aq|ag|ar|am|aw|au|at|az|bs|bh|bd|bb|by|be|bz|bj|bm|bt|bo|ba|bw|bv|br|io|bn|bg|bf|bi|kh|cm|ca|cv|ky|cf|td|cl|cn|cx|cc|co|km|cg|cd|ck|cr|ci|hr|cu|cy|cz|dk|dj|dm|do|ec|eg|sv|gq|er|ee|et|fk|fo|fj|fi|fr|gf|pf|tf|ga|gm|ge|de|gh|gi|gr|gl|gd|gp|gu|gt| gg|gn|gw|gy|ht|hm|va|hn|hk|hu|is|in|id|ir|iq|ie|im|il|it|jm|jp|je|jo|kz|ke|ki|kp|kr|kw|kg|la|lv|lb|ls|lr|ly|li|lt|lu|mo|mk|mg|mw|my|mv|ml|mt|mh|mq|mr|mu|yt|mx|fm|md|mc|mn|ms|ma|mz|mm|na|nr|np|nl|an|nc|nz|ni|ne|ng|nu|nf|mp|no|om|pk|pw|ps|pa|pg|py|pe|ph|pn|pl|pt|pr|qa|re|ro|ru|rw|sh|kn|lc|pm|vc|ws|sm|st|sa|sn|cs|sc|sl|sg|sk|si|sb|so|za|gs|es|lk|sd|sr|sj|sz|se|ch|sy|tw|tj|tz|th|tl|tg|tk|to|tt|tn|tr|tm|tc|tv|ug|ua|ae|gb|us|um|uy|uz|vu|ve|vn|vg|vi|wf|eh|ye|zm|zw|com|edu|gov|int|mil|net|org|biz|info|name|pro|aero|coop|museum|arpa))|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$ |
Description |
This is a robust email validation: the username part conforms with RFC 2822 (for instance, emails with tags ("+") are validated).
The host part is checked for valid subdomains and its TLD is checked against all the 243 countries codes and the 14 ICANN'sTLDs. The host part also accepts IP with or without brackets. |
Matches |
|
Non-Matches |
|
Author |
Rating:
Philippe Benthien
|
Title |
Test
Details
Email Validator
|
Expression |
^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$ |
Description |
This accepts RFC 2822 email addresses in the form:<br> [email protected] OR<br> Blah < [email protected]><br> <br> RFC 2822 email 'mailbox':<br> mailbox = name-addr | addr-spec<br> name-addr = [display-name] "<" addr-spec ">"<br> addr-spec = local-part "@" domain<br> |
Matches |
|
Non-Matches |
|
Author |
Rating:
Kunal Chowdhury
|
Title |
Test
Details
Email address (RFC 2821 mailbox)
|
Expression |
^\s*(([/-9!#-'*+=?A-~-]+(?:\.[/-9!#-'*+=?A-~-]+)*|"(?:[^"\r\n\\]|\\.)*")@([A-Za-z][0-9A-Za-z-]*[0-9A-Za-z]?(?:\.[A-Za-z][0-9A-Za-z-]*[0-9A-Za-z]?)*|\[(?:[^\[\]\r\n\\]|\\.)*\]))\s*$ |
Description |
This validates against the RFC 2821 (SMTP) syntax unit 'Mailbox' [equiv. to addr-spec - not address - element of RFC 2822] (the one a certain critic keeps linking to validates the RFC822 'address' element which includes support for stuff like "Group:User <address>,User <address>;", obsolete smtp routing syntax like <@host1,@host2:user@host>, etc)
There are some differences. This version does not allow line breaks for continuation lines. It also applies the stricter standards of RFC 2821 (SMTP) to the domain portion of the address.
Username may be a quoted string (but not "multiple"."quoted"."strings" - RFC 2822's grammar appears to allow this but the SMTP grammar does not). Also only one piece enclosed in [Brackets] (for IP email addresses) is allowed in the domain; that is you can't have user@[1.2.3.4].[5.6.7.8] as implied by the RFC2822 but not SMTP. Whitespace is only allowed in quoted strings. It is silently ignored at the beginning or end.
Capture group 1 is the email address, group 2 is the username, group 3 is the domain. |
Matches |
|
Non-Matches |
|
Author |
Rating:
Not yet rated.
Jordan
|
Title |
Test
Details
Email - RFC 2821, 2822 Compliant
|
Expression |
^((([!#$%&'*+\-/=?^_`{|}~\w])|([!#$%&'*+\-/=?^_`{|}~\w][!#$%&'*+\-/=?^_`{|}~\.\w]{0,}[!#$%&'*+\-/=?^_`{|}~\w]))[@]\w+([-.]\w+)*\.\w+([-.]\w+)*)$ |
Description |
According to RFC 2821 (<see cref="http://tools.ietf.org/html/2821"/>)
and RFC 2822 (<see cref="http://tools.ietf.org/html/2822"/>), the local-part
of an email addresses may use any of these ASCII characters:
1. Uppercase and lowercare letters
2. The digits 0 through 9
3. The characters, !#$%&'*+-/=?^_`{|}~
4. The character "." provided that it is not the first or last character in the local-part. |
Matches |
|
Non-Matches |
|
Author |
Rating:
Dave Black
|
Title |
Test
Details
atext
|
Expression |
[a-zA-Z0-9!#\$%&'\*\+\-\/=\?\^_`{\|}~] |
Description |
atext as defined in RFC 2822 |
Matches |
any%text |
Non-Matches |
any text |
Author |
Rating:
Not yet rated.
Gustav Kusnir
|
Displaying page
of
pages;
Items to