you can at yii2 in the Model Rules enter patterns in passwords ? Tips for a rule that at least one uppercase character and at least one number ? Thanks so much
Rules
['password', 'pattern' => '(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20}'],
Your case probably does not work because for some reason Yii2 does not recognize \d or \p so you have to write this part manually or find a way around.
I have tested this one:
/^(?=.*[0-9])(?=.*[A-Z])([a-zA-Z0-9]+)$/
This means it will require at least one upper-case letter and at least one digit (lower-case letters are not necessary).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With