sanniassin / react-input-mask

Input masking component for React. Made with attention to UX.
MIT License
2.22k stars 258 forks source link

uuid mask #202

Closed giolvani closed 4 years ago

giolvani commented 4 years ago

Hi, it is not exactly a issua, but a help!

Im trying do a mask for a uuid pattern: /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/ but I can't do this yet.

Somebody could help me do this mask?

giolvani commented 4 years ago

With purpose to keep using my constant, I solved it using something like this: '00000000-0000-0000-0000-000000000000'.split('').map(u => u === '0' ? /[0-9a-fA-F]/ : u)

It returns an array that I can use em mask property.