Js正则校验

//只能输入包含2为小数以内的正浮点数
var oneCount = parseFloat(KaTeX parse error: Undefined control sequence: \d at position 34: … var ex = /^(\̲d̲+|\d+\.\d{1,2})/;
if (ex.test(oneCount)) {
} else {
$_this.val(’’)
return
}

你可能感兴趣的:(js)