title: AngularJS 1.x: How to show custom message in ng-pattern?
body: <p>I am creating a form and trying to put in following password validation:</p>
  
  <p>Minimum 8, at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character:</p>
  
  <p>Using the following regrex:</p>
  
  <pre><code>"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&amp;])[A-Za-z\d$@$!%*?&amp;]{8,}/"
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>Password:&lt;input type="text" name="pass" ng-model="password" ng-pattern="/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.{8,}$)(?=.*[$@$!%*?&amp;])[A-Za-z\d$@$!%*?&amp;]/" required /&gt;
  &lt;span style="color:Red" ng-show="personForm.pass.$error.required"&gt; Required! &lt;/span&gt;
  &lt;span style="color:Red" ng-show="personForm.pass.$dirty&amp;&amp;personForm.pass.$error.pattern"&gt;Please Enter Valid Pass&lt;/span&gt;
  </code></pre>
  
  <p>Now, what I want to do is display dynamic message to the user as he fills the password. E.g. if he has filled the uppercase, lowecase , special character but has not filled the number, I want to display that "Password should contain number".
  Is it possible without clicking on submit?
  Or should I do it at the click of button instead?</p>