美文网首页
正则验证邮箱

正则验证邮箱

作者: yuki20 | 来源:发表于2020-03-23 10:08 被阅读0次

/**

* 验证邮箱

*/

export function isEmail(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,}))$/

return re.test(email)

}

相关文章

网友评论

      本文标题:正则验证邮箱

      本文链接:https://www.haomeiwen.com/subject/wfmiyhtx.html