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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(?:[a-zA-Z0-9_'^&/+-])+(?:\.(?:[a-zA-Z0-9_'^&/+-])+)*@(?:(?:\[?(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\.){3}(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\]?)|(?:[a-zA-Z0-9-]+\.)+(?:[a-zA-Z]){2,}\.?)$
Description
this will validate most legal email addresses, even allows for some discouraged but perfectly legal characters in local part; allows IP domains with optional []; keeps final tld at a minmum of 2 chars; non capturing groups for efficiency
Matches
you.me.hello@somewhere.else.cc | joe_smith@here.com. | me@[24.111.232.1]
Non-Matches
.me.you@here.com | .murat@62.59.114.103.nl | test_case@here*555%there.com
Author Rating: Not yet rated. Micah Duke
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: Doesn't handle double quotes
Name: Zeke Hudock
Date: 11/12/2007 2:30:21 PM
Comment:
Does not handle double quotes around the name (which is valid for an RFC2822 address).


Title: Email validation which only allows certain specific email address
Name: bruce
Date: 11/30/2006 8:01:40 AM
Comment:
How is it possible to have a regular validation expression where the ending of the email address (after the @) has to be the same. Therefore only allowing people with that type of email address to register yo my site.


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