title: Invalidate numbers with leading zeros with Validators.pattern(..)
body: <p>I have a validator that uses a regex pattern <code>/^[1-9][0-9]*$/</code> to only allow numbers without leading zeros. </p>
  
  <p>This can expression can easily be tested like so:</p>
  
  <pre><code>/^[1-9][0-9]*$/.test("04") // returns false
  /^[1-9][0-9]*$/.test("40") // returns true
  </code></pre>
  
  <p>The ReactiveForm is defined as:</p>
  
  <pre><code>form = new FormGroup({
    'sum': new FormControl(null, Validators.pattern(/^[1-9][0-9]*$/))
  })
  </code></pre>
  
  <p>And the template is</p>
  
  <pre><code>&lt;form [formGroup]="form"&gt;
    &lt;input type="number" formControlName="sum" style="display:block; margin-bottom:10px;"&gt;
    &lt;button type="submit" [disabled]="!form.valid"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When I use this in a ReactiveForm, entering a the number <code>04</code> should add the class <code>ng-invalid</code> to the field and mark the form as invalid. </p>
  
  <p>Instead the form is marked valid and the class <code>ng-valid</code> are added to the field. </p>
  
  <p>I reproduced it <a href="https://stackblitz.com/edit/angular-z2ggrf" rel="nofollow noreferrer">here</a></p>