HomeRegex LibraryStrong Password Policy Regex
100% Client-Side β€’ 0 B Data Leaves Browser
security

Strong Password Policy Regex

Enforces minimum 8 chars, at least 1 uppercase, 1 lowercase, 1 digit, and 1 special symbol.

Regular Expression Pattern:
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/
Valid Match Example:
P@ssw0rd2026!
Invalid / Non-Match Example:
password

Regex Syntax Breakdown & Explanation

  • β€’(?=.*[a-z]) : At least one lowercase letter
  • β€’(?=.*[A-Z]) : At least one uppercase letter
  • β€’(?=.*\d) : At least one digit
  • β€’(?=.*[@$!%*?&]) : At least one special symbol
  • β€’{8,} : Minimum length of 8 characters

Implementation in Popular Languages

JavaScript / TypeScript
const regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
const isValid = regex.test("P@ssw0rd2026!");
console.log(isValid); // true
Python (re)
import re

pattern = r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$"
match = re.match(pattern, "P@ssw0rd2026!")
print(bool(match)) # True
Go (regexp)
package main
import (
  "fmt"
  "regexp"
)

func main() {
  re := regexp.MustCompile(`^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$`)
  fmt.Println(re.MatchString("P@ssw0rd2026!"))
}
Frequently Asked Questions

Frequently Asked Questions

Everything you need to know regarding specifications, syntax, and security best practices.

The regular expression pattern is /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/. Enforces minimum 8 chars, at least 1 uppercase, 1 lowercase, 1 digit, and 1 special symbol.