Regular expression for password (at least 2 digits and one special character and minimum length 8)

后端 未结 6 1473
情歌与酒
情歌与酒 2020-11-30 06:27

I have been searching for regular expression which accepts at least two digits and one special character and minimum password length is 8. So far I have done the following:

6条回答
  •  死守一世寂寞
    2020-11-30 06:37

    Try this : ^.*(?=.{8,15})(?=.*\d)(?=.*\d)[a-zA-Z0-9!@#$%]+$

    Please read below link for making password regular expression policy:-

    Regex expression for password rules

提交回复
热议问题