Sean Turtle
Sean Turtle

Reputation: 53

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

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?

Upvotes: 1

Views: 1867

Answers (2)

Nadheem
Nadheem

Reputation: 1

data-parsley-pattern="[a-zA-Z0-9\pL\s\-]+$"

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

Upvotes: 0

Anand
Anand

Reputation: 207

data-parsley-pattern="(?=.*[a-z])(?=.*[A-Z]).*"

Upvotes: 2

Related Questions