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
You will have to build up the regular expression like this:
rule = [ "[a-z]", "[A-Z]", "[0-9]", "[!@#$%\^\&\(\)\+=]" ]
regex = ""
first = true
for a in 0..3:
for b in 0..3:
if a == b: continue
for c in 0..3:
if a == c or b == c: continue
if not first:
regex += "|"
regex += "(" + rule[a] + ".*" + rule[b] + ".*" + rule[c] + ")"
first = false
I'm not sure if I escaped the special characters correctly. It's kind of dependant on the language/toolkit you're using.