I’m trying to get a regular expression that allows between 6 – 15 characters and can be a-zA-Z0-9 and the symbols above the numbers 1–8 on a keyboard.
Here’s what I have but it doesn’t work.
'/^[a-zA-Z0-9-_][\!\@\#\$\%\^&\*]{5,16}+$/'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you have two different sets within brackets. Basically the expression says “1 of a-zA-Z0-9-_” followed by 5-16 of special characters. Combine them into the same set of brackets and you’re all good.
Something like the following: