ngx-mask
ngx-mask copied to clipboard
when using "*" character as a custom pattern, it gets counted as one less than the amount entered
hi, I am trying to use '*' as a custom pattern:
customPattern = {
'9' : { pattern: new RegExp('\[0-9\]') },
'a' : { pattern: new RegExp('\[a-zA-Z\]') },
'*' : { pattern: new RegExp('\[a-zA-Z0-9\]') }
};
myMask = "***-***"
in html:
<input type="text" [mask]="this.myMask" [patterns]="this.customPattern">
the mask is functioning as if I entered **-** instead of ***-***, if I change the mask to ****-****, then it functions as ***-*** always acting as if there is one less star character than I have entered. Am I doing something wrong on my end? Are there any workarounds? Any input is appreciated
this is probably related to #958 , I was not able to find that ticket via search but just saw it
Thanks for your using Ngx-Mask. Please update to latest version. It example, all work as expected - https://stackblitz.com/edit/angular-dn6ajx?file=src%2Fmain.ts