title: Angular 9 - Validators.pattern('^[0-9][0-9][0-9]$') doesn't match with leading 0 number like 012
body: <p>in order to validate a simple PIN, which can include leading 0, I wrote the following very-simple regexp:</p>
  
  <pre><code>^[0-9][0-9][0-9][0-9][0-9][0-9]$
  </code></pre>
  
  <p>This one works as expected on the different online regexp tools I tried, however, it doesn't work in Angular validator, because of the leading 0 which is not counted as a digit:</p>
  
  <pre><code>  PIN = new FormControl('', [
      Validators.required,
      Validators.minLength(6),
      Validators.maxLength(6),
      Validators.pattern('^([0-9][0-9][0-9][0-9][0-9][0-9])$'),
    ]);
  
    formPINGroup = this.formBuilder.group({
      PIN: this.PIN,
    });
  </code></pre>
  
  <p>I can't figure this out despite the different forums I browsed, people are always looking for the opposite.</p>
  
  <p>If an Angular expert sees this post, his help is welcomed!</p>
  
  <p>In the meantime, take care!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I have created a Stackblitz if you wanna try something:
  <a href="https://stackblitz.com/edit/angular-zzsjn1" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-zzsjn1</a></p>
  
  <p>here three results:</p>
  
  <ul>
  <li>the first is not OK because of the leading 0 </li>
  <li>second is ok because I added number 6, at the end</li>
  <li>the last one is wrong, obviously.</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/smrAW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/smrAW.png" alt="enter image description here"></a></p>