← Pattern Library PATTERN
Security · Validation
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\w\s]).{8,}$/
Security · Validation Flags:
Description
A strong-password rule that uses lookaheads to check that at least one lowercase letter, uppercase letter, digit, and special character are each present and that the length is 8 or more. A great example of the (?=...) pattern when several conditions must be required at once.
Example Matches
Passw0rd!
S3cure#Key
Test String
Passw0rd!
Open this pattern in the tester
Other Patterns