Browsing this Thread:
1 Anonymous Users
How to validate password with regular expression |
||
|---|---|---|
|
Just can't stay away
![]()
Joined:
2007/11/1 12:10 Group:
Registered Users Posts:
103
Level : 9; EXP : 15
HP : 0 / 203 MP : 34 / 1233 ![]() |
How to validate password with regular expression
((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20}) Description * ?= means apply the assertion formula, meaningless by itself, always work with other combination. * . means any characters except new line \n * * means length can be zero or more * () grouping * (?=.*\d) \d means digit from 0-9. Only digit is allow here. * (?=.*[a-z]) [a-z] means lowercase characters from a to z. Only lowercase characters is allow here. * (?=.*[A-Z]) [A-Z] means uppercase characters from A to Z. Only uppercase characters is allow here. * (?=.*[@#$%]) [@#$%] means special character @#$%. Only special characters @#$% is allow here. * {6,20} the length of the string, minimum characters is 6, maximum characters is 20. Whole combination is means, 6 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol (@#$%). This regular expression pattern is very useful to implement a strong and complex password. P.S The grouping formula order is doesnt matter.
Posted on: 10/26 15:00
|
|
Transfer
|
||
You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.



Transfer
