title: Access ng-pattern in error message
body: <p>I have an ng-repeat for a list of attributes and want to show error messages for each input. For a pattern error I also want to show the specific regex it has to match.</p>
  
  <p>Can I access an input's pattern somehow? I know I could add an attribute containing the regex but I would like to know if there is an angular way somehow.</p>
  
  <p>(This is an oversimplified example, the regexes can be different for different attributes)</p>
  
  <pre><code>&lt;form name="form"&gt;
      &lt;div data-ng-repeat="(attributeName, attributeMetaData) in configuration.metaData"&gt;
  
          &lt;input data-ng-model="configuration[attributeName]" type="text" name="{{attributeName}}" data-ng-pattern="/^[0-9][0-9]:[0-9][0-9]$/"&gt;
  
          &lt;span data-ng-show="form[attributeName].$error.pattern &amp;&amp; form[attributeName].$dirty"&gt;
              Please check your input format [pattern should go here]
          &lt;/span&gt;   
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>jsFiddle: <a href="http://jsfiddle.net/lisapfisterer/ndu2g0ev/" rel="nofollow">http://jsfiddle.net/lisapfisterer/ndu2g0ev/</a></p>