I'm working on a project that needs to write some java code to check supplied passwords against corporate standards. I'm the system administrator, but they've asked me for some regular expression help. First, the rules:
- be at least 14 characters in length
- consist of a mix of all four character sets - upper case, lower case, numeric, and special characters
- contain no more than three consecutive characters from any one of the four classes
The regular expression I've come up with is:
Code:
((?=.*\d{1,3}?)(?=.*[a-z]{1,3}?)(?=.*[A-Z]{1,3})(?=.*[:punct:]{1,3}?).{14,})
It's failing on the last requirement. If anyone has some suggestions, I'd love to hear them.
Regards,
Brad