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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?<user>(?:(?:[^ \t\(\)\<\>@,;\:\\\"\.\[\]\r\n]+)|(?:\"(?:(?:[^\"\\\r\n])|(?:\\.))*\"))(?:\.(?:(?:[^ \t\(\)\<\>@,;\:\\\"\.\[\]\r\n]+)|(?:\"(?:(?:[^\"\\\r\n])|(?:\\.))*\")))*)@(?<domain>(?:(?:[^ \t\(\)\<\>@,;\:\\\"\.\[\]\r\n]+)|(?:\[(?:(?:[^\[\]\\\r\n])|(?:\\.))*\]))(?:\.(?:(?:[^ \t\(\)\<\>@,;\:\\\"\.\[\]\r\n]+)|(?:\[(?:(?:[^\[\]\\\r\n])|(?:\\.))*\])))*)
Description
Validates email addresses according to the RFC 822 specification. The only exception is the exclusion of control characters, which should be sufficient for human input from a keyboard.
Matches
Trais.Gray@domain.biz | "Funny email".notfunny@glxs.biz | ok@[funny domain].co.za
Non-Matches
"TravisGray"extra@ domain.biz
Author Rating: The rating for this expression. Trevor Green
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: It works!
Name: Gabriel
Date: 11/1/2013 8:03:25 AM
Comment:
Never mind, I've randle with it. After studying a bit more I discovered that part isn't important, it's like"comment". It's working perfectly! Thanks


Title: Title
Name: Gabriel
Date: 10/31/2013 5:27:41 PM
Comment:
What do you mean with (?<user> at the beginning? I'm having problems to add the regex to my .java file. I was using this site to help http://www.regexplanet.com/advanced/java/index.html#


Title: Title
Name: Gabriel
Date: 10/31/2013 5:27:28 PM
Comment:
What do you mean with (?<user> at the beginning? I'm having problems to add the regex to my .java file. I was using this site to help http://www.regexplanet.com/advanced/java/index.html#


Title: Title
Name: Gabriel
Date: 10/31/2013 5:27:09 PM
Comment:
What do you mean with (?<user> at the beginning? I'm having problems to add the regex to my .java file. I was using this site to help http://www.regexplanet.com/advanced/java/index.html#


Title: No.1
Name: Vanger
Date: 4/8/2008 11:56:41 AM
Comment:
Excellent work! Works perfectly! Very, very big thank you!


Title: RE: You're also missing a lot of the essential things, like comments.
Name: Trevor Green
Date: 4/21/2005 2:40:44 AM
Comment:
Yeah - but I'm not validating the entire RFC 822 - only the email address part. As far as I can tell, RFC 822 describes ARPA Internet Text Messages, but in that description it prescribes a syntax for email addresses that we have become familiar with. It is that portion that is validated, the portion that reduces to the non-terminal "addr-spec" (found in RFC 822). I'm sure that if we were validating an entire RFC822 message, then the regular expression that is described in the link that you have given is more appropriate.


Title: You're also missing a lot of the essential things, like comments.
Name: Randal L. Schwartz
Date: 4/20/2005 1:38:05 PM
Comment:
See http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html If it's shorter than that, it's not correct.


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