📅  最后修改于: 2022-03-11 14:48:20.503000             🧑  作者: Mango
validateEmail(email) {
if(email!=''){
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,}))$/;
console.log(re.test(String(email).toLowerCase()))
this.emailTest = re.test(String(email).toLowerCase())
if (this.emailTest != true) {
this.toastr.warning("please enter valid email")
return;
}
}
}