I want to allow users to fill password with at least 7 character(no limit) that must have 1 numeric and 6 alphabet.
Asked
Active
Viewed 244 times
-1
-
You should think about using zxcvbn. Google it. – Brian Gottier Aug 23 '17 at 05:55
-
at least one numeric right? – user10089632 Aug 23 '17 at 05:56
-
1I believe a key requirement is that of the minimum 7 characters, 6 must be alphabetic so that, for example, "pass1234" would not match. So I don't agree that this is a duplicate of the other questions referenced. Here is a solution that works for me: ^(?=(.*[A-Za-z]){6})(?=[A-Za-z]*\d)[A-Za-z0-9]{7,}$ – Anthony Aug 23 '17 at 06:33
-
I don't know why this marked as duplicate, anyways thanks a lot @Anthony, you understand my requirement exactly what I need and saved my time. This exactly works for me. Thanks once again! – Ravee Sunshine Aug 23 '17 at 08:27
1 Answers
0
/^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+)$/
this is regex for atleast 1 digit in password

Anis
- 1,190
- 2
- 13
- 26