Can any one provide me regx validator which validate the following;
Password must be an alphanumeric password i.e. at least 1 number and at least 1 alphabet.
I tried the following, but it did not work.
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9])$
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 are almost there, you just need to add a quantifier for your last expression and it will work fine. So, it should be something like this
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{2,})$.Code will look like this
You are currently matching a single digit or a letter as
[a-zA-Z0-9]matches a single alphanum character. Read about character classes([]) here http://www.regular-expressions.info/charclass.html