常用正则表达式
var myreg = /^1[0-9]{10}$/;//判断是否为手机号码 var mypwd = /^[0-9A-Za-z]{6,}$/;//密码长度不少于6位,并且由数字和字符组成 var IDCard = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$/;//身份证号码验证
var regCard = /^([1-9]{1})(\d{14}|\d{18})$/;// 正则验证银行卡号
var reg = /^([1-9]\d*|0)(\.\d{1,2})?$///数字精确到小数点后两位
Detail.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {//正则匹配img标签src
console.log(capture)
});