Front-end common rules

            // Tabs
            table: /\t/g,
            // newline
            line: /\n/g,
            // positive and negative integers or floats
            intOrFloat: /^(-)?\d+(\.\d+)?$/,
            // ID card
            idCard: /^\d{15}$|^\d{18}$|^\d{17}(\d|X|x)$/,
            // cellphone number
            MobileNo: /^1[34587]\d{9}$/,
            // Bank card number (a number greater than or equal to 16 digits)
            CardNo: /^\d{16,}$/,
            // Short verification code (more than 6 digits)
            MobileCode: /^\d{6,}$/,
            // Transaction password (6-16 digits or letters)
            OrderPassword: /^\S{6,16}$/,
            // thousandths regex
            parseThousands: /(\d{1,3})(?=(\d{3})+(?:$|\.))/g,
            // every 4 characters separated by spaces
            bankCardNo: /(\d{4})(?=\d)/g,
            // Amount detection
            moneyTest: /^(0|[1-9]\d*)(\.\d{1,2})?$/,
            // card number mask
            parseToStarNumber: /^(\d{4})(\d+)(\d{4})$/,
            // last four bits mask
            parseRightFourStar: /^(\w+)(\w{4})$/,
            // date format detection
            parseDateFormat: /\b(\d{4})\b[^\d]+(\d{1,2})\b[^\d]+(\d{1,2})\b(\s(\d{1,2})\:(\d{1,2})\:(\d{1,2}))?[^\d]?/,
            // birth date mask, display format ('19**year**month*2')
            userBirthdayStarRegex: / (\ d {2}) \ d {2} ([^ \ d] +) \ d + ([^ \ d] +) \ d? (\ d) ([^ \ d] +)? / ,
            // Amount conversion
            moneyReplace: /[^0-9\.]/g,

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326752186&siteId=291194637