PiJava

May 4, 2009

Javascript Email Validation (Regular Expression)

Filed under: JavaScript — Tags: , , — pijava @ 2:20 pm
function isValidEmail(email)
{
  var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

  if(!filter.test(email))
    return false;
  return true;
}

1 Comment »

  1. you are great dude. I was looking for this code everywhere. please keep goin on your work, thank you.

    Comment by George Milton — October 9, 2009 @ 7:43 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Create a free website or blog at WordPress.com.