0

How can I create password validation with case sensitivity and special characters detection for password detection in react native?

2

1 Answer 1

2

Use the below regex for a password check of uppercase lower case number and special characters

function checkPassword(str)
{
    var re =  /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$/;
    return re.test(str);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.