Closed juanlatorre closed 3 years ago
Hi @juanlatorre, I'll take a look at this as soon as I can
@juanlatorre the validation is done for each character against a item on the mask array, so the regex /\d{1,3}/
will actually behave the same as /\d/
. If you want to allow three digits in sequence you should use [/\d/, /\d/, /\d/]
.
If you need some dinamically rule, use a function to do your logic, like that:
const myMask = (value: string) => {
if (something) {
return [/\d/]
} else {
return [/\d/, /\d/, /\d/]
}
}
Thanks for the quick validation, I will implement a custom mask function then !
Hi, currently this kind of regex are not working at all.
\d{1,3}