发布于 3年前

js正则验证邮箱

/**
 * 验证邮箱
 */
export function isEmailAvailable(emailInput) {
    var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
    if (!myreg.test(emailInput)) {
        return false;
    } else {
        return true;
    }
}
©2020 edoou.com   京ICP备16001874号-3