vue-the-mask icon indicating copy to clipboard operation
vue-the-mask copied to clipboard

Number or regex pattern

Open gustavokrause opened this issue 6 years ago • 3 comments

Is there a way to input only numbers or something like that?

and 'F' is a mask where allows only numbers, (multiple numbers) ??

hexTokens: {
  F: {
    pattern: /[0-9]+/,
  }
}

gustavokrause avatar May 03 '18 19:05 gustavokrause

'#': {pattern: /\d/}, is a default token for only numbers input. If you are using :tokens then you have to set your own tokens like you already did.

Alcoine avatar Jun 10 '18 18:06 Alcoine

I think he meant "any amount of numbers". Stumbled across this just now.

I have an input where I need to only allow numbers (undefined number of digits). Right now you need to know the exact amount of digits of your allowed number.

@Jujeu I don't think that there is an actual (regex-)pattern support in this library.

bernhardberger avatar Jan 17 '20 15:01 bernhardberger

@bernhardberger could you find a solution

nguyenk avatar Dec 20 '21 10:12 nguyenk