简体   繁体   English

密码正则表达式 - 最少 12 个字符,应包含 1 个大写、小写、数字和特殊字符,并且不应包含超过 2 个重复字符

[英]Password RegEx - Minimum 12 char, Should contain 1 Uppercase & Lowercase & Number & Special Char and should not contain more than 2 repeated char

I am looking for an password regEx.我正在寻找一个密码正则表达式。 which should cover the following conditions应涵盖以下条件

  1. 1 Uppercase 1 大写
  2. 1 Lowercase 1 小写
  3. 1 Number 1 个
  4. 1 Special Char 1 个特殊字符
  5. should not contain more than 2 repeated char (Eg: SaaC - allowed, Saaac - Not allowed)不应包含超过 2 个重复字符(例如:SaaC - 允许,Saaac - 不允许)

你能试试这个吗?

/^(?!.*([A-Za-z0-9])\\1{2})(?=.*[az])(?=.*[AZ])(?=.*[0-9])(?=.*[!@#\\$%\\^&\\*])(?=.{12,})/.test('some-text-here')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为密码创建正则表达式验证长度为8-24,并至少包含以下3个:小写,大写,数字,特殊字符 - How to create regex for passwords validate with length 8 - 24 and contain at least 3 of the following: lowercase, uppercase, numbers, special char 如何验证电子邮件ID和密码和密码应包含小写,大写和最小一个字符,这两个字段应该是内联的? - how to validate email id and password and password should contain lowercase,uppercase and minimum one character and both fields should be inline? 正则表达式以相邻的小写和大写Char为目标 - Regex to target adjacent lowercase and uppercase Char 正则表达式-如果包含单词,则最后一个字符必须为空格 - Regex - if contain word, then last char must be whitespace 密码的正则表达式必须至少包含八个字符,至少一个数字以及大小写字母和特殊字符 - Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters 正则表达式特殊字符? - regex special char? 带有特殊字符的正则表达式问题 - Regex issue with special char 密码应至少包含 1 位数字 - ValidateJS 中的正则表达式 - Password should contain at least 1 digit - Regex in ValidateJS 匹配char序列和其他不包含char序列的char序列 - Match char sequence and other char sequences that do not contain char sequence 如果字符串包含此字符,如何验证? - How to validate a string if it contain this char?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM