I have been struggling with the errors not showing for a regex valuation with at least one no, char, special char and number.
TypeScirpt
<mat-form-field class="form-element">
<input matInput id="password1" placeholder="New password" formControlName="password1">
<label *ngIf="resetPasswordForm.get('password1').errors && resetPasswordForm.get('password1').hasError('required') &&
(resetPasswordForm.get('password1').dirty || resetPasswordForm.get('password1').touched)" >Errorasdf</label>
</mat-form-field>
resetPasswordForm = this.formBuilder.group({
password1: ['',[ Validators.required, Validators.pattern(/^(?=\D*\d)(?=[^a-z]*[a-z])(?=[^A-Z]*[A-Z])(?=.*[$@$!%*?&*()]).{8,16}$/) ]],
password2: ['',[ Validators.required, Validators.pattern(/^(?=\D*\d)(?=[^a-z]*[a-z])(?=[^A-Z]*[A-Z])(?=.*[$@$!%*?&*()]).{8,16}$/) ]],
})