I need jquery validation for password
I need jquery regular expression which have at least one alphabet and one number.
I tried this /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/;
regular expression but it doens't work when i add special characters in it, does anyone have idea about this type of regular expression, any help will be really appreciated.
Asked
Active
Viewed 163 times
0

Nikul Panchal
- 85
- 1
- 11
1 Answers
0
Something you should look into is validate.js. A simple jQuery library for validating strings (min, max etc). And after a quick google, I found plenty of other people with the same question as yours. Here's one: jQuery Validate plugin - password check - minimum requirements - Regex.
In this question, @Bergi gives an answer with the following regex
/^(?=.*[a-z])[A-Za-z0-9\d=!\-@._*]+$/
The min and max attributes are being handled via validate.js. Hope this helps!

Community
- 1
- 1

Gustaf Gunér
- 2,272
- 4
- 17
- 23