实在弄不出来,求JS验证QQ,手机正则 一个textarea,接收一组文本,如果存在QQ号,手机号,弹出确认框,如果用户选择YES,提交,但是把QQ,手机号替换为***提交,否则返回FALSE让用户自己改正。正则实在有点难懂,弄到大半夜弄不出。特来请教高手。谢谢。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var regx = /^[1-9]{1}\d{4-10}$/;alert(regx.test("1234556"));验证5-11位,首位 不为0的数字 注意1楼的正则有些小错误:var regx = /^[1-9]\d{4,10}$/; alert(regx.test("1234556")); 字符串中有一个:replace方法,可以去试一下。 整好了,测试通过,有需要的朋友可以参考下(回者有分,结了)。function include_qq_phone(num_v) { num_v = num_v.replace(/(\s*)/g, ''); var regx = /[1-9]\d{4,10}/; if (regx.test(num_v)) { return true; } else if (num_v.match(/13\d{9}/g) || num_v.match(/15[0-35-9]\d{8}/g) || num_v.match(/18[05-9]\d{8}/g)) { return true; } return false;}/*下面是引用*/ if (include_qq_phone(Description.value)) { asyncbox.tips("请不要包含QQ号|手机号等信息"); return false; } alert("可提交"); jquery获取type=radio值 Ext如何设置Form的each的readOnly 请问这个正则表达式怎么写? 给出匹配金钱的正则表达式 请问radio按纽问题 判断radiobuttonlist 是否为空(急!在线等!) 关于框架赋值问题!!!!!!!!!!!!!!请大家可以帮忙解决 那有下载scriptx.cab控件的地址,谢谢帮忙!! 网页的渐变特效怎么写 利用js排序 各位大侠,这有一个字符串处理问题,请问哪位高人有思路,在线等 Ext饼图显示数值问题?
alert(regx.test("1234556"));
验证5-11位,首位 不为0的数字
alert(regx.test("1234556"));
function include_qq_phone(num_v) {
num_v = num_v.replace(/(\s*)/g, '');
var regx = /[1-9]\d{4,10}/;
if (regx.test(num_v)) { return true; }
else if (num_v.match(/13\d{9}/g) || num_v.match(/15[0-35-9]\d{8}/g) || num_v.match(/18[05-9]\d{8}/g)) {
return true;
}
return false;
}
/*下面是引用*/
if (include_qq_phone(Description.value)) {
asyncbox.tips("请不要包含QQ号|手机号等信息");
return false;
}
alert("可提交");