title: angularJS: ng-pattern for multiple matches of pattern
body: <p>It seems like a common way to validate values that are comma-separated is to split them into an array, then perform the regEx match on each member. However, I would like to take advantage of Angular's instant validation and perform this match in the view.</p>
  
  <p>My regEx:</p>
  
  <pre><code>^\d{5}?,*$
  </code></pre>
  
  <p>works perfectly on the first match, but I'm at a loss as to how to ask it to check for this pattern n-times.</p>
  
  <p>Form Code:</p>
  
  <pre><code>        &lt;form id="zipCodeForm" name="zipCodeForm"  ng-submit="submit()" &gt;
              &lt;input id="zipCodeInput" ng-model="text" name="text" type="text"
              required ng-pattern="/^\d{5}?,*$/" &gt; &lt;/input&gt;
  
              &lt;input id="zipSubmit" type="submit" value="Submit" class="btn btn-large btn-primary"&gt;&lt;/input&gt;
              &lt;div class="alert alert-info formatguide" ng-show="zipCodeForm.text.$dirty &amp;&amp; zipCodeForm.text.$invalid"&gt;
                 Enter Comma Separated 5-Digit Zip Codes ex.(11111,22222,33333)
              &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>