// 主键 a-z A-Z 0-9 _-
primary: {
validator: /^[a-zA-Z0-9_-]+$/,
message: '{{label}} 只能为数字、字母的组合'
},
word: {
validator: /^[a-zA-Z_-]+$/,
message: '{{label}} 只能为英文字母'
},
email: {
validator: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/,
message: '请填写正确的邮箱地址'
},
tel: {
validator: /(^[0-9]{3,4}-[0-9]{7,8}$)|(^[0-9]{7,8}$)|(^\([0-9]{3,4}\)[0-9]{7,8}$)/,
message: '电话号码格式为: 区号-固话 或 固话 或(区号)固话'
},
phone: {
validator: /^[1]([3-9])[0-9]{9}$/,
message: '请填写正确的手机号码'
},
url: {
validator: /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,
message: '请填写正确的网址'
},
idCard: {
validator: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/,
message: '请填写正确的身份证号码'
},
moreThanZero: {
validator: /^[1-9]{1}[0-9]*$|^0{1}\.{1}[0-9]+$|^[1-9]{1}[0-9]*\.{1}[0-9]+$/,
message: '{{label}} 必须大于零'
},
//手机号或电话号
telOrPhone:{
validator: /(^[0-9]{3,4}-[0-9]{7,8}$)|(^[0-9]{7,8}$)|(^\([0-9]{3,4}\)[0-9]{7,8}$)|(^[1]([3-9])[0-9]{9}$)/,
message: '请填写正确的手机号码/电话号码!电话号码格式为: 区号-固话/固话/(区号)固话!'
}