I currently have the following regex:
^(?!.*([A-Za-z0-9])\1{2})(?=.*[a-zA-Z])(?=.*\d)[A-Za-z0-9]+$
The entire thing will have the RegexOption.IgnoreCase
set. So far it requires:
- at least one letter anywhere
- at least one number anywhere
- not more than two of the same letter or number consecutively (aAa283 is bad, aa83Aa is fine)
I just need to change the "at least one letter" to "at least 3 letters". I've come up with the following, and it seems to work but I just need to be absolutely sure:
^(?!.*([A-Za-z0-9])\1{2})(?=(.*[a-zA-Z]){3})(?=.*\d)[A-Za-z0-9]+$