I need to validate my password field with some special character.This field should contain at least one number,upper case ,lowercase letter and underscore and these are mandotary.I am using ng-pattern and ng-message but failed to do this.I am explaining my code below.
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">Password :</span>
<div ng-class="{ 'has-error': billdata.pass.$touched && billdata.pass.$invalid }">
<input type="{{inputType}}" name="pass" id="contactno" class="form-control" placeholder="password" ng-model="password" ng-minlength="8" ng-pattern="/[a-zA-Z][0-9][a-zA-Z0-9]{3}/." >
</div>
</div>
<div class="help-block" ng-messages="billdata.pass.$error" ng-if="billdata.pass.$touched">
<p ng-message="minlength" style="color:#F00;">This field is too short.The min length of your password should be 8.</p>
<p ng-message="pattern" style="color:#F00;">This field needs the special character like number,upper case,lower case letter,underscore.</p>
</div>
Here i am not getting any error message.Please help me.
.from regex.ng-pattern="/[a-zA-Z]\d\w{3}/", but this will allow the characters in the same order