Need regular expression for checking at least 3 uppercase, 3 lowercase, 3 digits and 3 special character

前端 未结 3 1725
天命终不由人
天命终不由人 2021-01-19 06:22

Need regular expression for checking at least 3 uppercase, 3 lowercase, 3 digits and 3 special character any where in string.

I have tried /^(?=.*[^A-Za-z0-9]

3条回答
  •  长情又很酷
    2021-01-19 06:40

    Both of the other answers fail for a string which doesn't match the "at least 3 lowercase" requirement. Using Bohemian's answer but supporting that case gives the following regex:

    ^(?=(.*[^A-Za-z0-9]){3})(?=(.*[A-Z]){3})(?=(.*[a-z]){3})(?=(.*\d){3}).+

提交回复
热议问题