ttk-app-core
Version:
@ttk/recat enterprise develop framework
43 lines (30 loc) • 1.33 kB
JavaScript
// 密码
// export const password = /(?![0-9A-Z]+$)(?![0-9a-z]+$)(?![a-zA-Z]+$)[\w,.?/~!@#$%^&*():;\\\|/<>'"\[\]{}\-\+=,。?、;:‘”「」|【】¥·!《》]{8,16}$/;
// export const password = /(?![0-9A-Z]+$)(?![0-9a-z]+$)(?![a-zA-Z]+$)[A-Za-z0-9]{8,16}$/;
export const password = /(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])[\w,.?/~!@#$%^&*():;\\\|/<>'"\[\]{}\-\+=,。?、;:‘”「」|【】¥·!《》]{8,16}/
// 数字
export const number = /^[1-9]\d*$/
// 小数位
export const decimal = /^(\d+(\.\d+)?)?$/
// 邮箱
export const email = /^[A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
// 手机
export const phone = /^1[3-9]\d{9}$/
//电话
export const tel = /^0\d{2,3}-?\d{7,8}$/
// 电话与手机
export const telAndphone = /^0\d{2,3}-?\d{7,8}$|^1[0-9]{10}$/
// 金额
export const money = /^(0|[1-9]\d*)(\.(\d{1,2}))?$/
// 特殊金额
export const moneySpe = /^(0|[1-9]\d*)(\.(\d{1,6}))?$/
// 比率 小于100,保留一位小数
export const rate = /^(0|[1-9]\d?)(\.\d)?$/
// 比率 小于或等于100,保留一位小数
export const rateAll = /^(0|[1-9]\d?)(\.\d)?$|^100(\.0)?$/
// 纳税人识别号
export const nsrsbh = /^([A-Za-z0-9]{15,20})$/
// 不允许有空格
// export const space = /^[^\s]*$/g
// 不允许前后空格
// export const spaceTrim = /^[^\s].+[^\s]$/g