Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters

前端 未结 30 3635
伪装坚强ぢ
伪装坚强ぢ 2020-11-21 04:28

I want a regular expression to check that:

A password contains at least eight characters, including at least one number and includes both lower and uppercase letter

30条回答
  •  粉色の甜心
    2020-11-21 05:07

    Use the following Regex to satisfy the below conditions:

    Conditions: 1] Min 1 special character.
                2] Min 1 number.
                3] Min 8 characters or More
    

    Regex: ^(?=.*\d)(?=.*[#$@!%&*?])[A-Za-z\d#$@!%&*?]{8,}$

    Can Test Online: https://regex101.com

提交回复
热议问题