EasyRegex Logo
EasyRegex
New

Validate Password Strength

Javascript

Regular Expression

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Copy
Do you have Feedback?

Explanation

This regex pattern enforces the following rules for password strength: at least one lowercase letter, one uppercase letter, one digit, one special character (@$!%*?&), and a minimum length of 8 characters.

Javascript

Example Usage

const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/; const isValidPassword = passwordRegex.test('StrongP@ssw0rd');
Copy
Test the expression

Similar Regular Expressions