Regular Expressions 101

Community Patterns

Community Library Entry

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 - 2 years ago (Last modified 2 years ago)