Hi,
I need a regex for a password which meets following constraints in my rails project:
- have a minimum of 8 and a maximum of 16 characters
- be alphanumeric only
- contain at least one letter and one number.
My current regex is:
/^(?=.*\d)(?=.*([a-z]|[A-Z])).{8,16}$/
This allows me all the restrictions but the special characters part is not working. What is it that I am doing wrong. Can someone please correct this regex?
Thanks in advance.