ng-pattern not accepting '@' special character in validation

45 Views Asked by At

NET MVC, HTML 5 and Angularjs, i am having trouble on using ng-pattern in the password field validation. this is my pattern

ng-pattern="/^(?=.*[0-9])(?=.*[!#$%^&*])[a-z0-9!#$%^&*]{8,16}$/"

I need to validate the passwoerd field must contains minimum 8 characters and contains alphanumeric and atleast 1 special character. when i use @ as a special character in the password field the error says use atleast one special character. regex pattern not considering @ as a special character.

Also i have included @ symbol in this group !@#$%^&* in the above pattern though its giving the error in my MVC page.

0

There are 0 best solutions below