邮箱验证正则

function validateemail()

{

         var accemail = document.getElementById("accemail");    //获取email控件对象
         if (!accemail.value == "") {
                   var reg =/^/w+([-+.]/w+)*@/w+([-.]/w+)*/./w+([-.]/w+)*$/;

                   var bool = reg.test(accemail.value);
                   if (bool == false) {
                           alert("邮箱格式错误,请重新输入!");
                           accemail.focus();
                           return;
                   }
         }    

}

 

你可能感兴趣的:(function,email)