| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- // 效验电话
- export const phoneReg = /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/;
- // 效验qq
- export const qqReg = /^[1-9][0-9]{4,10}$/;
- // 效验微信号
- export const wechatReg = /^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/;
- // 效验邮箱
- export const emailReg = /^([A-Za-z0-9_\-.])+@([A-Za-z0-9_\-.])+\.([A-Za-z]{2,4})$/;
- // 效验手机号码
- export const mobileReg = /^1\d{10}$/;
- // 短信验证码
- export const smsCodeReg = /^\d{6}$/;
- // 密码
- export const passwordReg = /^(?=.*\d)(?=.*[a-zA-Z]).{6,16}$/;
- // 效验身份证
- export const idCardReg = /^[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]$/;
- // 效验url
- export const urlReg = /^((https?|ftp|file):\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/;
- // 效验Ipv4
- export const ipv4Reg = /^(?:(?: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]?)$/;
- // 效验十六进制颜色正则
- export const rgbReg = /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/;
- // 只能输入字母、下划线,且字母开头结尾,不能__两个下划线相连
- export const letterAndUnderlineReg = /^[A-Za-z]([A-Za-z]|_[A-Za-z])*$/;
- // 正整数
- export const positiveIntegerReg = /^[1-9]\d*$/;
- // 整数
- export const integerReg = /^-?[1-9]\d*$/;
- // 数字
- export const numberReg = /^(-?\d+)(\.\d*)?$/;
- // 中文姓名
- export const chineseNameReg = /^[\u4e00-\u9fa5]+[·-]?[\u4e00-\u9fa5]+$/;
- // md5
- export const md5Reg = /^[a-f\d]{32}|[A-F\d]{32}$/;
- // 公司名称
- export const companyNameReg = /^[\u4e00-\u9fa5()()\da-zA-Z&]{2,}$/;
- // 二级域名
- export const subdomainReg = /^[a-z0-9-]{4,20}$/;
|