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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
x
Description
This regular expression matches email addresses that match the format specified by RFC 821 (see the BNF notation at http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc0821.html#page-30)
Matches
x
Non-Matches
non@match@.
Author Rating: Not yet rated. Jason Howat
Source
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: Obvious problem
Name: Jeff
Date: 12/5/2004 5:40:46 PM
Comment:
There seems to be a major problem with this. It will match jeff@nokrev, even though it has no tld extension.


Title: Possible Problem
Name: Matt
Date: 5/27/2004 2:44:14 PM
Comment:
I used the address mike.o'[email protected] and got an exception error. This looks like more of a .NET error than an error with your expression but I've had cases where people's email addresses have the single quote in them. Causes me big headaches when trying to store them in a database through SQL. System.ArgumentException: parsing "^(([^<>;()[\]\\.,;:@"]+(\.[^<>()[\]\\.,;:@"]+)*)|(".+"))@((([a-z]([-a-z0-9]*[a-z0-9])?)|(#[0-9]+)|(\[((([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\.){3}(([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\]))\.)*(([a-z]([-a-z0-9]*[a-z0-9])?)|(#[0-9]+)|(\[((([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\.){3}(([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\]))$" - Not enough )'s. Parameter name: ^(([^<>;()[\]\\.,;:@"]+(\.[^<>()[\]\\.,;:@"]+)*)|(".+"))@((([a-z]([-a-z0-9]*[a-z0-9])?)|(#[0-9]+)|(\[((([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\.){3}(([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\]))\.)*(([a-z]([-a-z0-9]*[a-z0-9])?)|(#[0-9]+)|(\[((([01]?[0-9]{0,2})|(2(


Title: fails on numeric domains
Name: capn lunch
Date: 5/8/2004 3:06:34 PM
Comment:
doesn't match [email protected] a perfectly valid domain name


Title: no special characters
Name: Olaf
Date: 4/24/2004 2:29:25 AM
Comment:
Hi the new special characters in URLs are not accepted: irgendwer.0815a-QQ4@team-nöhring.museum the Ö does not work. Olaf


Title: Have a look at this one
Name: SmudgeCat
Date: 8/11/2003 8:00:00 AM
Comment:
This one seems to cover all: www.ex-parrot.com/~pdw/Mail-RFC822-Address.html


Title: only it doesn't work
Name: pinetree
Date: 6/16/2003 4:01:14 PM
Comment:
Except that per RFC 822 (http://www.w3.org/Protocols/rfc822/Overview.html), the following email addresses are valid but would be trapped as invalid by this code. Specifically, look at Appendix A (http://www.w3.org/Protocols/rfc822/Overview.html#z10), section A.3.3.<br><br> "Some Silly User"@example.com<br> Another'[email protected]<br> Yet/Another/Wacky/[email protected]


Title: Very good!
Name: Michele
Date: 4/14/2003 5:34:21 PM
Comment:
Your regexp is great! It doesn't match all my fake emails! But this site doesn't display the regexp correctly: in the row Expression for example appear the html code &lt;! /^(([^<>;()[\]\\.,;:@\"]+(\.[^<>()[\]\\.,;:@\"]+)*)|(\".+\"))@((([a-z]([-a-z0-9]*[a-z0-9])?)|(#[0-9]+)|(\[((([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\.){3}(([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\]))\.)*(([a-z]([-a-z0-9]*[a-z0-9])?)|(#[0-9]+)|(\[((([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\.){3}(([01]?[0-9]{0,2})|(2(([0-4][0-9])|(5[0-5]))))\]))$/


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