var phone = $(i).val(); phone = phone.replace(/(^\s*)/g, ""); var re = /^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$|(^(13[0-9]|15[0|2|3|6|7|8|9]|18[3|6|7|8|9])\d{8}$)/;//该句 if (!re.test(phone)) { alert("电话号码输入有误!"); return false; }
时间: 2024-11-05 13:03:44