Use the following ng-pattern
:
ng-pattern="/^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@('@')$!%*#?&{}[\]<>()^+=;:'"/\\|-])[A-Za-z\d$@('@')$!%*#?&{}[\]<>()^+=;:'"/\\|-]{8,20}$/"
Note that \
and ]
are escaped in the character class with \
and the double quotes are represented as a "
HTML entity. The hyphen does not need escaping when at the character class end.
See the updated plunkr.
Post a Comment for "Ng-pattern For Password Text To Accept All Special Characters And Numbers, Alphabets"