Try it out on these example inputs:

back to RegexSwap.

Email address

Regular expression:

[a-zA-Z0-9._%+-]*@[a-zA-Z0-9._%+-]*\.[a-zA-Z]{2,4}

Categories:

Popularity:

You need to be logged in to cast votes on regexes.

Good
2
Bad
0

Author description and comments (2)

Topic by
kasper

2009-01-05
22:19

Description

This is definitely not the final word on an email address regular expression, but it's useful and definately narrows down the options. There are however some known issues such as no literal top-level domain check.

Comment by
chiaochi


I would add A-Z to the last a-z too, just in case someone use upper case on ".com"

So:
[a-zA-Z0-9._%+-]*@[a-zA-Z0-9._%+-]*\.[a-zA-Z]{2,4}

Comment by
kasper


I agree, fixed! :)

You need to be logged in to participate

In order to post your own comments on this regex, you need to be logged in.

Username:

Log in by clicking the login link at the top of the screen