ASP.NET Regular Expression Validator (Password Strength)

前端 未结 3 1809
渐次进展
渐次进展 2021-02-03 11:32

I have a validation control that has the following expression:

(?=(.*\\\\d.*){2,})(?=(.*\\\\w.*){2,})(?=(.*\\\\W.*){1,}).{8,}

That\'s a passwor

3条回答
  •  不思量自难忘°
    2021-02-03 11:52

    This will get you 2 min digits, 2 min characters, and min 8 character length... I refuse to show you how to not allow users to have non-alphanumeric characters in their passwords, why do sites want to enforce less secure passwords?

    ^(?=.*\d{2})(?=.*[a-zA-Z]{2}).{8,}$
    

提交回复
热议问题