Parsley custom validator - password with number, uppercase letter and special character

1.8k Views Asked by At

I'm using Parsley to validate a registration form. The client has now asked to force users to use at least one uppercase letter, number and special character. I'm wondering if it's possible to achieve this by creating a custom validator with Parsley, rather than implementing additional code?

2

There are 2 best solutions below

0
On
data-parsley-pattern="(?=.*[a-z])(?=.*[A-Z]).*"
0
On
data-parsley-pattern="[a-zA-Z0-9\pL\s\-]+$"

include your special character as"\special_character" inside square bracket