I am creating regex for password validation. Password must start with letter, and must contain 1 uppercase and 3 lowercase letters among the other things.
This is what I got
^[a-zA-Z](?=.*[A-Z])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z])(?=.*[!@#$%^&*~].*[!@#$%^&~*])(?!.*(.)\1\1)[a-zA-Z0-9!@#$%^&*]{8,12}$
If I start with uppercase letter and there is not any other uppercase, validation is negative. It is same for lowercase.
Aasd23#$s
invalidAasd23#$sA
validaAas23$%6$
invalidaAas23$%6$a
valid
Can someone help me?
^
, thus evaluated before the lookaheads and not regocnigez inside those. - Sebastian Proske