I have angular 5 with "angular2-text-mask": "^8.0.4" https://github.com/text-mask/text-mask/tree/master/angular2
What I'm trying to do is preventing users entering special characters, except for -, _, ', which should be allowed for a name type="text"
input.
This works for phone numbers:
<input [textMask]="{mask: mask}" [(ngModel)]="myModel" type="text"/>
public myModel = ''
public mask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]
But when I try public mask = [/^[a-zA-Z]+$/];
which is supposed to accept multiple letters, however I can only write one. What's wrong?
I like to be able to enter unlimited letters, digits and -, _, '
I tested my mask at https://regex101.com/
Any help is appreciated.