react-input-mask icon indicating copy to clipboard operation
react-input-mask copied to clipboard

Any length of letters?

Open 3runoDesign opened this issue 3 years ago • 4 comments

How to just filter anything except letters and set ANY length?

mask= "a" - Only one letter mask = "aaaaaaaaaa" - Only ten letters etc

Is it possible to set any length of letters?

Something like: ^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ0-9]+$ Thank you!

3runoDesign avatar Aug 20 '20 05:08 3runoDesign

I have the same doubt, anything new about this???

marciogurka avatar Sep 18 '20 13:09 marciogurka

<MaskedInput mask={Array.from({ length: 43 }, () => /^[А-я-і-ї-І-Ї-0-9 .']$/)} maskPlaceholder="" /> It's work for me

vovasapsay avatar Nov 23 '20 17:11 vovasapsay

Thanks for the replies, but I think none of them are really answering the question. The original question is if there is a way to require only letters without having to set strict length set to the mask. Like in the regex below:

^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ0-9]+$

Defining long-length masks as a way to support multiple lengths is a workaround.

I have the same question, but from I've been reading upon I am afraid this library doesn't support dynamic lengths 😞

gbgdev avatar Jul 19 '21 09:07 gbgdev