I would like to create a preg_match function to validate my passowrds, but I'm not sure how to write it to allow the following special characters to be used: !@#$%.
if(!preg_match(?????)$/', $password))
Here are my password rules that I want to work into the regex:
- May contain letter and numbers
- Must contain at least 1 number and 1 letter
- May contain any of these characters:
!@#$% - Must be 8-12 characters
Thank you for any help you can offer.