A sensible PasswordStrengthRegularExpression

后端 未结 2 1099
渐次进展
渐次进展 2021-02-01 09:16

We\'re using the standard ASP.NET authentication provider (AspNetSqlMembershipProvider as it happens) and the defualt password strength requirement is a little excessive for our

2条回答
  •  礼貌的吻别
    2021-02-01 10:17

    Here is a regex that allows all characters and requires at least one number and requiring at least 6 characters.

    ^.*(?=.{6,})(?=.*\d).*$
    

    If you want more or less characters defined simply change (?=.{6,}) to reflect the number of characters you want as a minimum.

提交回复
热议问题