1function validateEmail (emailAdress)
2{
3 let regexEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
4 if (emailAdress.match(regexEmail)) {
5 return true;
6 } else {
7 return false;
8 }
9}
10
11let emailAdress = "test@gmail.com";
12console.log(validateEmail(emailAdress));
13
1function validateEmail(email) {
2 var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3 return re.test(String(email).toLowerCase());
4}
5
1function validateEmail(email) {
2 const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3 return re.test(String(email).toLowerCase());
4}
1function isValidEmail(email) {
2 const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3 return re.test(String(email).toLowerCase());
4}
1/* JavaScript: validating email address */
2
3isValidEmail("xyz@abc.com"); // true
4
5function isValidEmail(email) {
6 var emailRegex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
7 return !!email && typeof email === 'string'
8 && email.match(emailformat)};
9};
1function validateEmail(email) {
2 const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
3 return re.test(String(email).toLowerCase());
4}
5