{2,4} indicates the minimum and maximum number of characters.This will allow domain names with 2, 3 and 4 characters e.g.; us, tx, org, com, net, wxyz).On the final line we call test method for our regular expression and pass the email address as input.

We can validate email address at client side and server side.

To validate email address on client side, we can use java script with regular expression.

Java script can check the regular expression pattern for valid email address.

We have different regular expression patterns for validating email address.

In this article, I am sharing some useful cross browsers regular expression patterns for validating email address with java script and jquery.

Below is simple regular expression to validate an email address. $(document).ready(function(e){ $('#btn Submit').click(function(){ var email = $('#txt Email').val(); if ($.trim(email).length == 0) { alert('Please Enter Valid Email Address'); return false; } if (validate Email(email)) { alert('Valid Email Address'); return false; } else { alert('Invalid Email Address'); return false; }}); }); In this article I try to explain, how you can validate different-different email address acc. I hope after reading this article you will be able to use this trick in your code.

I would like to have feedback from my blog readers.

Last month I wrote about regular expressions in Java, today I’ll show you how to use regular expression in Java Script to validate email address.

Here is the code to validate email address in Java Script using regular expression.