Check out example codes for "mat-form-field email validation". It will help you in understanding the concepts better.

Code Example 1

<input matInput placeholder="Favorite food" [(ngModel)]="enterEmail" name="myEmail" pattern="[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}" required>

Learn ReactJs, React Native from akashmittal.com