📅  最后修改于: 2022-03-11 15:03:12.643000             🧑  作者: Mango
const isValidEmail = email => {
const regexEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
return email.match(regexEmail);
};
const emailAdress = "test@gmail.com";
console.log(isValidEmail(emailAdress)); // true