What can be a valid regex for a password that contains at least 8 characters in which there should be one upper-case,one lower-case and one number?
Asked
Active
Viewed 60 times
0
-
Password validation is a question asked about 329,000 times on SO, Welcome to StackOverflow !. – May 26 '18 at 21:09
-
You may find [Reference - Password Validation](https://stackoverflow.com/questions/48345922/reference-password-validation) relevant. Password rules are old. – ctwheels May 30 '18 at 15:31
1 Answers
0
Here is a regular expression for a string with at least 8 characters, one upper-case, one lower-case and one number.
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$

TriThomas
- 383
- 2
- 16