Javascript regex to validate that it contains 6 characters and in which one character (1) should be a number.
var pwdregex =/^[A-Za-z1-9]{6}$/;
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.
This will guarantee exactly one number (i.e. a non-zero decimal digit):
And this will guarantee one or more consecutive number:
And this will guarantee one or more not-necessarily-consecutive number:
All of the above expressions require exactly six characters total. If the requirement is six or more characters, change the
{6}to{6,}(or remove the$from{6}$).