Hi, Anyone can explain to me why regex expression in pattern property is not working
<input type="password" pattern="(?=.*[a-zA-Z])(?=.*[0-9])" minlength="6" [class.is-invalid]="passwordForm.errors && passwordForm.touched" #passwordForm="ngModel" name="password" required class="form-control" [(ngModel)]="password">
but i run in typescript it work well
var mediumRegex = new RegExp("(?=.*[a-zA-Z])(?=.*[0-9])");
console.log(
mediumRegex.test("123asA")
);
--->true
console.log(
mediumRegex.test("")
);
--->false
console.log(
mediumRegex.test("aaaa")
--->false
); console.log(
mediumRegex.test("1z")
);
--->true