Regular Expressions 101

Community Patterns

Strict password match

0

Regular Expression
ECMAScript (JavaScript)

/
(?<=.*([!-~].*){8,})(?<=.*[a-z].*)(?<=.*[A-Z].*)(?<=.*[0-9].*)(?<=.*[!-/:-@\[-`{-~].*)$
/
gm

Description

Matches any password with 8 ASCII characters (from ! to ~), 1 lowercase letter, 1 uppercase letter, 1 number and 1 symbol.

For testing multiple passwords, each one has to be in a separate line, if a password is valid, its first character is found.

Submitted by anonymous - a year ago (Last modified a year ago)