regexp.ts 922 B

12345678910111213141516171819202122
  1. /** 手机号码正则 */
  2. export const REGEXP_PHONE =
  3. /^[1](([3][0-9])|([4][01456789])|([5][012356789])|([6][2567])|([7][0-8])|([8][0-9])|([9][012356789]))[0-9]{8}$/;
  4. /** 邮箱正则 */
  5. export const REGEXP_EMAIL = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
  6. /** 密码正则(密码为6-18位数字/字符/符号的组合) */
  7. // export const REGEXP_PWD =
  8. // /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)]|[()])+$)(?!^.*[\u4E00-\u9FA5].*$)([^(0-9a-zA-Z)]|[()]|[a-z]|[A-Z]|[0-9]){6,18}$/;
  9. export const REGEXP_PWD = /^[(0-9a-zA-Z)]{6,18}$/;
  10. /** 6位数字验证码正则 */
  11. export const REGEXP_CODE_SIX = /^\d{6}$/;
  12. /** 4位数字验证码正则 */
  13. export const REGEXP_CODE_FOUR = /^\d{4}$/;
  14. /** url链接正则 */
  15. export const REGEXP_URL =
  16. /(((^https?:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)$/;