RegexPatterns.java 885 B

123456789101112131415161718192021222324252627282930
  1. package com.ruoyi.asset.utils;
  2. public abstract class RegexPatterns {
  3. /**
  4. * 负浮点数
  5. */
  6. public static final String NEGATIVE_FLOAT = "^-([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*)$";
  7. /**
  8. * 手机号正则
  9. */
  10. public static final String PHONE_REGEX = "^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\\d{8}$";
  11. /**
  12. * 用户名正则 大小写英文与数字
  13. */
  14. public static final String USERNAME_REGEX = "^[a-zA-Z0-9]+$";
  15. /**
  16. * 邮箱正则
  17. */
  18. public static final String EMAIL_REGEX = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";
  19. /**
  20. * 密码正则。4~32位的字母、数字、下划线
  21. */
  22. public static final String PASSWORD_REGEX = "^\\w{4,32}$";
  23. /**
  24. * 验证码正则, 6位数字或字母
  25. */
  26. public static final String VERIFY_CODE_REGEX = "^[a-zA-Z\\d]{6}$";
  27. }