js 四位字母、数组的正则表达式

//自定义验证格式,格式AAAA,BBC?,AB??,AACC
	"airport": {
                    // credit: jquery.h5validate.js / orefalo
                    "regex": /(^[a-zA-Z]{4}|^[a-zA-Z]{2}[\?]{2}|^[a-zA-Z]{3}[\?]{1})([,]([a-zA-Z]{4}|[a-zA-Z]{2}[\?]{2}|[a-zA-Z]{3}[\?]{1}))*$/,
                    "alertText": "* 格式错误,如:AAAA,BBC?,AB??,AACC"
 },
//自定义时间格式,格式0000-9999,
	"starttime": {
                    // credit: jquery.h5validate.js / orefalo
                    "regex": /(^[0-1][0-9]|^2[0-3])[0-5]{1}[0-9]{1}$/,
                    "alertText": "* 格式错误,前两位表示小时,后两位表示分钟,范围在0000-2359"
 },
 //自定义长度格式,格式0000-9999,
             "controlLevel": {
               // credit: jquery.h5validate.js / orefalo
                "regex": /(^[1-9][0-9]*)([,]([1-9][0-9]*))*$/,
},

相关推荐