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, if you enter the email address with domains gmail.com,yahoo.com,and live.com, the check Mail function throws alert 'Please enter a valid email address'.
By using this you can force user to enter only Corporate Email Address and stop user from entering some unwanted Email Domain Address.
In this page we have discussed how to validate an email using Java Script : I have a function where I validate emails via a regex.
I was wondering if this is the best regex to use or if there's a better way of doing it.Here is the code to validate email address in Java Script using regular expression.