title: Regex in angular- first digit not zero, but allow single zero
body: <p>I want to have input element which allows one of two conditions:</p>
  
  <ul>
  <li>Single zero can be entered</li>
  <li>Number with max of 9 digits can be entered, but first digit shouldn't be zero</li>
  </ul>
  
  <p>I wrote this regex (solution works in online regex testers):</p>
  
  <pre><code>/(^0$)|(^[1-9]\d{0,8}$)/
  </code></pre>
  
  <p>But when I use it in ng-pattern in Angular, it doesn't work.
  Here is my plunker example:</p>
  
  <p><a href="http://plnkr.co/edit/iDQ7ly8ypJ3UmN5A0hJw?p=preview" rel="nofollow">http://plnkr.co/edit/iDQ7ly8ypJ3UmN5A0hJw?p=preview</a></p>
  
  <p>Not sure if alternation is doing the problems, or I messed up the regex.</p>
  
  <p>UPDATE: it seems that type="number" is causing problems. Unfortunately, I need to have this in my code, so I'm searching for solution which works with type="number".</p>