Regular Expressions 101

Community Patterns

Password secure but flexable

1

Regular Expression
PCRE (PHP <7.3)

/
(^(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[a-z\!.@$%&*+=\-\_?]).{8,20}$)
/

Description

Must have at leat one number, at leat one capital letter, at least one lower case letter. Also you can have special characters !.@$%&+=-_? if you want for extra security. This is not manditory. Change (?=.[a-z!.@$%&+=-_?]) to (?=.[!.@$%&*+=-_?]) to make thees special characters manditory.

No less than 8 no more thant 20 characters allowed.

Submitted by strik009 - 9 years ago