How to Validate Email Address in JavaScript ?

Published on June 7, 2015 by abundantcode

Filed under JavaScript

Last modified June 7, 2015

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 3434 times

Here’s a sample JavaScript function that shows how to validate an email address .

How to Validate Email Address in JavaScript ?

function ValidateEmail(email) 
{
    var result = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    return result.test(email);
}
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


x

You might be Interested in these Posts

C Program to display Inverted half-pyramid using *

Problem Write a program in C to print Inverted half-pyramid using * as shown below.The program shou...

How to use array Rank in C# ?

In C# , the Rank property of the array is is used to get the rank of the array. In simple terms , ra...

ES6: The future is now at Warrington on October 18 , 2016

JavaScript North West User Group is hosting its user group meet on the topic "ES6: The future i...