Regular Expressions 101

Community Patterns

Community Library Entry

32

Regular Expression
ECMAScript (JavaScript)

/
^(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[^\w\d\s:])([^\s]){8,16}$
/
gm

Description

This regex matches only when all the following are true:

password must contain 1 number (0-9) password must contain 1 uppercase letters password must contain 1 lowercase letters password must contain 1 non-alpha numeric number password is 8-16 characters with no space

Submitted by qho - 7 years ago (Last modified a year ago)