Security

Strong Password

Enforce strong passwords: min 8 chars, at least one lowercase, uppercase, digit, and special character.

Try it in RegexPro →

Available in

Pattern

regexengine-agnostic
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d\s]).{8,}$

Raw source: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d\s]).{8,}$

How it works

Uses four lookaheads from the start (^) to assert each required character class exists somewhere in the string, then .{8,} ensures minimum length, and $ anchors the end.

Examples

Input

MyP@ssw0rd

Matches

  • MyP@ssw0rd

Input

password123

No match

Input

SHORT1!

No match

Common use cases

  • User registration form validation
  • Password policy enforcement
  • Admin panel access controls
  • Security compliance checks

Related patterns

Related concepts