Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^([A-Za-z]+(\d[A-Za-z\d]*([^A-Za-z\d].*\S|[^A-Za-z0-9 ])|[^A-Za-z\d][^\d]*(\d.*\S|\d))|\d+([A-Za-z][A-Za-z\d]*([^A-Za-z\d].*\S|[^A-Za-z\s\d])|[^A-Za-z\d][^A-Za-z]*([A-Za-z].*\S|[A-Za-z]))|[^A-Za-z\d\s][^A-Za-z\d]*([A-Za-z][^\d]*(\d.*\S|\d)|\d[^A-Za-z]*([A-Za-z].*\S|[A-Za-z])))$
/
mg

Description

Matches valid passwords that require letters, numbers and special characters that do not start or end with spaces.

Submitted by anonymous - 5 years ago