var regp = /^(+86|86|)1[3458][0-9]{9}$/; if(str==""){ var flag = checkstatus(obj,"","0#7"); }else if(!regp.test(str) ){ var flag = checkstatus(obj,"","0#8"); }