Posted By

wbowers on 02/28/08


Tagged

regex email javascript js textmate validation


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

somedirection
kitsched


JavaScript - is_valid_email


 / Published in: JavaScript
 

  1. function is_valid_email (email)
  2. {
  3. return /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email);
  4. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: elightbo on March 11, 2008

This snippet was causing firefox to freeze on longer email addresses.

Posted By: elightbo on March 12, 2008

This snippet was causing firefox to freeze on longer email addresses.

Posted By: wbowers on April 5, 2008

hm, interesting. How long was the email address?

Posted By: kitsched on October 15, 2009

It works great for me, thank you.

You need to login to post a comment.