tool::regex-guide
regex password
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/
Strong Password Validation
Regex Pattern
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/Flags:
nonePattern Breakdown
(?=.*[a-z])Must contain at least one lowercase letter(?=.*[A-Z])Must contain at least one uppercase letter(?=.*\d)Must contain at least one digit(?=.*[@$!%*?&])Must contain at least one special character[A-Za-z\d@$!%*?&]{8,}Only allowed chars, minimum 8 lengthMatching Examples
✓
Passw0rd!✓
MyStr0ng@Pass✓
C0mpl3x!PwdNon-Matching Examples
✗
password✗
PASSWORD1✗
Pass1234✗
P@ss!Validates strong passwords requiring at least 8 characters with at least one uppercase letter, one lowercase letter, one digit, and one special character. Uses lookaheads to enforce all conditions regardless of order.
Language Usage
Common Use Cases
- ▸Validate password strength on sign-up forms
- ▸Enforce rules on password change forms
- ▸Apply password policy to admin accounts
- ▸Validate API key format
- ▸Check security policy compliance
Related Patterns
ad · 300×250
// related tools