Regular Expressions Password validation regex A password containing at least 2 uppercase, 1 lowercase, 2 digits and is of length of at least 10


This can be done with a bit of modification in the above regex




Let's see how a simple regex ^(?=(?:.*?[A-Z]){2}) works on string abcAdefD

enter image description here

Image Credit :-