我希望这些打字格式和分机号码是可选的
(123)-456-7890 X 12345
Html:
<input type="text" placeholder="Phone" min="10" max="15" class="form-control" formControlName="phone"
mask="(000)-000-0000 x 00000"
[ngClass]="{ 'is-invalid': (isSaved && contactForm.phone.errors)}">
Typescript :
phone: ['', [Validators.pattern(this.commonRegex.PhoneWithExtRegex)]],
/\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})+\x([0-4]{5})/