- 验证邮箱是否正确
function isEmail(strEmail) {
var flag = strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/);
if (flag == -1){
//邮箱格式不正确
}
}
- 验证手机号是否正确
/^((13|14|15|17|18)[0-9]{1}\d{8})$/