Tag:rip mic highlight length ID for expression log turn
var verify = {/** * [determines whether the data is an integer] * @param {[number]} v [Digital] */Isinteger (v) { Return/(?: ^0 $)| (?: ^[^0\.) \d*?$)/.test (v); },/** * [determines if 6-bit verification code] * @param {[String]} v [Verification code] */Iscode:function (val) { Return/^\d{6}$/.test (Val); },/** * [bank card number is separated by four bits] * @param {[number]} v [Digital] */bankcodeformat:function (v) { v = ' + V; v = v.replace (/\s+/g, "). Replace (/(\d{4}|\*{4}|\*{3}\d{1}|\*{2}\d{2}|\*{1}\d{3})/g, ' $ '); Return v},/** * [only contains kanji] * @param {[String]} v [Kanji] */ischinese:function (Val) {return/^[\u4e00-\u9fa5]{0,}$/.test (val); },/** * [can contain only letters and numbers] * @param {[String]} v [Letters and numbers] */Isnotchinese:function (val) { Return/^[a-za-z0-9]{4,40}$/.test (Val); },/** * [Determines whether theNumber] * @param {[String]} v [number] */isnumber:function (v) {return!isnan (v) && V.indexof ('. '); },/** * [True is overflow, false is non-overflow] * @param {[String]} v [number] */isoverflow:function (v , Len) {var L = v.length; Len >> 0; return l > Len; },/** * ID number and binding with "*" ID number verification **/isid:function (val) {val = Val.replace (/\s+/g, ' ); Return/(^\d{17} ([0-9]| X)) | (^[1-9]{1}[*]{16}[0-9| X]) $/.test (Val); },/** * Binds the bank card number and the user entered the bank card * @param string as well as the number **/Isbank:function (val) {val = Val.replace (/\s+/g, "); Return/^ (\d{16}|\d{18}|\d{19}) | (^[*]{12,15}[0-9]{4}) $/.test (Val); },/** * brings out the phone number and user entered the phone number * @param string as well as the number **/Istel:function (val) {return /(^1[34578]\d{9}) $| (^[1]{1}[0-9]{2}[*]{4}[0-9]{4}) $/.test (Val); },/* Determine if the browser is open */is_weixn:function () {var ua = navigator.userAgent.toLowerCase (); if (Ua.match (/micromessenger/i) = = "Micromessenger") {return true; } else {return false; } } }
JS Common Regular Expression validation and description