1.0.6 • Published 4 years ago

@rk-init/regex v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

正则效验格式

// 手机号验证 export const isPhone = /^10-9{9}$/

// 密码验证 长度在6-24之间,必须包含大写字母、小写字母和数字 export const isPassword = /^.(?=.{8,16})(?=.\d)(?=.A-Z{1,})(?=.a-z{1,}).*$/

// 车牌号验证 export const isVehiclesNum = /^(京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z{1}a-zA-Z|京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z{1}A-Z{1}A-Z0-9{4}A-Z0-9挂学警港澳{1})$/

// 身份证验证 export const isIdCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/

// 验证邮箱 export const isEmail = /^(a-zA-Z|0-9)(\w|-)+@a-zA-Z0-9+.(a-zA-Z{2,4})$/

// 只能是中文 export const isChinese = /^\u0391-\uFFE5+$/

// 只能是字母 export const isLetter = /^a-zA-Z+$/

// 只能是数字 export const isNumber = /^0-9+$/

// 只能是字母和数字 export const isNumberLetter = /^0-9a-zA-Z+$/

// 图片验证 export const isImage = /.(png|jpg|gif|jpeg|webp)/gi

// 视频验证 export const isVideo = /.mp4/ig

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago