Javascript email validation

A simple javascript email validation.

function emailRegx(text){
  var pattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
  return (pattern.test(text)) ? true : false; 
}
Javascript email validation

One thought on “Javascript email validation

  • Pingback:Ross

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.