I need to validate passwords that needs to fulfill the following rules:
- Minimum length is 8 characters
- All characters need to be unique
- At least one of the characters is capitalized
- At least one character is a non-alphabetic character, a digit or a hyphen
- Non-alphabetic characters should not be placed as the first two or last two characters
I can't figure out how to validate this using regular expressions. Can anybody help me?