title: Phone number pattern validation in angular material designing
body: <p>I want to validate phone number using angular material designing code but  below code is not working even when i enter valid phone number ca n some on help me please</p>
  
  <pre><code> &lt;mat-form-field class="example-full-width"&gt;
                  &lt;input matInput placeholder="Phone number" formControlName="PhoneNumber"
                     [errorStateMatcher]="matcher" [(ngModel)]="PhoneNumber" required pattern="[6-9]\\d{9}" maxlength="10"&gt;
                       &lt;mat-hint&gt;Errors appear instantly!&lt;/mat-hint&gt;
                       &lt;mat-error *ngIf="emailForm.get('PhoneNumber').hasError('required')"&gt;
                         Phone number is &lt;strong&gt;required&lt;/strong&gt;
                       &lt;/mat-error&gt;
                        &lt;mat-error *ngIf="!emailForm.get('PhoneNumber').hasError('required') &amp;&amp;emailForm.get('PhoneNumber').hasError('pattern')"&gt;
                        Please enter valid mumber
                       &lt;/mat-error&gt;
            &lt;/mat-form-field&gt;
  
      ngOnInit() {
  
      //Form Group
      this.emailForm = new FormGroup({
        PhoneNumber:new FormControl('',[Validators.pattern(/^[6-9]\d{9}$/)]),
      });
  }
  </code></pre>
  
  <p><a href="https://stackblitz.com/edit/angular-2m1vdq-7vzaq8?file=app%2Finput-error-state-matcher-example.html" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-2m1vdq-7vzaq8?file=app%2Finput-error-state-matcher-example.html</a></p>