I have a list of passwords that I need to examine and determine if they meet the default 3 of 4 rule for AD.
Rule is contain 3 of the 4 following requirements: low
If you really want one big regex it would be something like this:
(?=^.{8,255}$)((?=.*\d)(?=.*[A-Z])(?=.*[a-z])|(?=.*\d)(?=.*[^A-Za-z0-9])(?=.*[a-z])|(?=.*[^A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z])|(?=.*\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9]))^.*
Note that it also enforces password length to be between 8 and 255 characters. You can change the "{8,255}" portion in the first section to adjust the length requirements. It is also worth noting that this is working for me in a standard ASP.NET RegularExpressionValidator control.
Matches: "Passw0rd" "passW@rd" "1B2a345@#$%"
Non-Matches: "123123123" "Password" "asdf&"
Source (Matthew Hazzard via RegExLib.com)