I'm trying to develop a regular expression for validating a password which should meet following criteria
- should have at least one Uppercase letter,
- should have at least one Lowercase letter,
- should have at least one Special character,
- should have at least one digit,
- must be minimum 6 characters long.
I have developed a expression for that:
password_pattern=/^(?=.*[0-9]) (?=.*[!@#$%^&*]) (?=.*[a-z]) (?=.*[A-Z]) {6} $/
However it is not working as I intended. What am I going wrong?
I'm new to regular expressions, so I'd appreciate an explanation rather than a 'use this' sort of answer, please explain.