^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Copier
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.
const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/; const isValidPassword = passwordRegex.test('StrongP@ssw0rd');
Copier