Regex for default ASP.NET Core Identity Password

前端 未结 1 807
夕颜
夕颜 2021-02-04 06:07

Note: This question, I believe, is not the duplicate of this question. My question is dealing with the default validation rules asp.net core identity has for pa

相关标签:
1条回答
  • 2021-02-04 06:16

    so, use

    ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[#$^+=!*()@%&]).{8,}$
    
    • ^: first line
    • (?=.*[a-z]) : Should have at least one lower case
    • (?=.*[A-Z]) : Should have at least one upper case
    • (?=.*\d) : Should have at least one number
    • (?=.*[#$^+=!*()@%&] ) : Should have at least one special character
    • .{8,} : Minimum 8 characters
    • $ : end line

    for more information: this

    0 讨论(0)
提交回复
热议问题