常规正则表达式
NO_VALIDATE: {label: '无特殊校验', pattern: ''},
EMAIL: {
label: '邮箱',
pattern: 'w[-w.+]*@([A-Za-z0-9][-A-Za-z0-9]+.)+[A-Za-z]{2,14}',
},
MOBILE: {
label: '手机号',
pattern: '^1[3-9]d{9}$',
},
PHONE: {label: '固定电话', pattern: '((d{3,4})|d{3,4}-|s)?d{8}'},
URL: {
label: 'URL',
pattern: '^((https?|ftp|file)://)?([da-z.-]+).([a-z.]{2,6})([/w .-]*)*/?$',
},
POSTCODE: {label: '邮政编码', pattern: '^[1-9][0-9]{5}$'},
IPV4: {
label: 'IPV4地址',
pattern:
'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$',
},
IPV6: {
label: 'IPV6地址',
pattern:
'^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$',
},
ID_CARD: {label: '身份证', pattern: 'd{17}[0-9Xx]|d{15}'},
CHINESE: {label: '汉字', pattern: /[\u4e00-\u9fa5]+$/.toString()},
ENGLISH: {label: '英文', pattern: '^[A-Za-z]+$'},
NUMBER: {label: '数字', pattern: 'd+'},
NATURAL_NUMBER: {label: '自然数', pattern: '^[0-9]+'},
ENGLISH_NUMBER: {label: '英文和数字', pattern: '^[A-Za-z0-9]+$'},
PATTERN: {label: '自定义', pattern: ''},