I want to create regex for
- Minimum 1 character and 1 number in password
- Prevent the “4 consecutive characters “ must be in place as well. Eg: 1234, abcd
- The minimum 8 characters and the maximum is 20
I have tried:
^(?!.*(.)\1\1)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,20}$
^(?!.*?(?:0(?:12|98)|123|234|3(?:45|21)|4(?:56|32)|5(?:67|43)|6(?:78|54)|7(?:89|65)|876|987))(?!.*?(.)\\1{2})[0-9]{8}$
^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,20}$
^(?=.*[0-9])(?=.*[a-zA-Z])(?=\S+$).{8,20}$
But not able to get result in one regex. Please help me if any one have idea for that. Thanks in advance!