I am trying to create a Regular Expression for password validation. Here are the requirements.
- Minimum length 8.
- At least 1 upper case.
- At least 1 lower case.
- At least 1 number.
- 0 or more of these characters !@#$%^&*?_~()- allowed.
- a-z allowed.
- A-Z allowed.
- 0-9 allowed.
Here is the expression i have so far:
^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*?_~()-]*).*$
This expression works mostly, except i need it to only allow bullets 5-9. Right now it will allow characters that are not specified, for example +=
.
How can i modify this expression to only allow bullets 5-9 and no other characters?