RegexConfig.cs 993 B

123456789101112131415161718
  1. using System.Text.RegularExpressions;
  2. namespace SC.XR.Unity.Module_PlatformAccount
  3. {
  4. /// <summary>
  5. /// 正则表达式配置
  6. /// </summary>
  7. public class RegexConfig
  8. {
  9. public static Regex format_phone = new Regex(@"^(\+?0?86?\-?)?(\d{7,})$");
  10. public static Regex format_bindingPhone = new Regex(@"^\+86(\d{7,})$");
  11. public static Regex format_email = new Regex(@"^.+@.+\..+$");
  12. //public static Regex format_password = new Regex(@"^(?=.*\d)(?=.*[A-Za-z]).{8,}$"); // 至少包含字母数字
  13. public static Regex format_password = new Regex(@"(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^.{8,}$"); // 至少包含字母数字字符中的两种
  14. public static Regex format_pinyin = new Regex(@"[\u4e00-\u9fa5]+"); // 是否包含中文
  15. public static Regex except_regionCode = new Regex(@"[^(\+?0?86?\-?)](\d{7,})$");
  16. }
  17. }