Regular Expressions 101

Community Patterns

Community Library Entry

5

Regular Expression
ECMAScript (JavaScript)

/
^.*(?=.{8,120})(?!.*\s)(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\!\@\#\$\%\^\&\*\(\)\-\=\¡\£\_\+\`\~\.\,\<\>\/\?\;\:\'\"\\\|\[\]\{\}]).*$
/

Description

Regular expression for password validation Rules: - 8-120 chars - no spaces - must contain at least one a-z char - must contain at least one A-Z char - must contain at least one digit - must contain at least one of the folowing chars: !@#$%^&*()-=¡£_+`~.,<>/?;:'"|[]{}

Submitted by @razvanz - 9 years ago