text-mask / text-mask

Input mask for React, Angular, Ember, Vue, & plain JavaScript
https://text-mask.github.io/text-mask/
The Unlicense
8.26k stars 828 forks source link

URL mask #889

Open mflash123 opened 5 years ago

mflash123 commented 5 years ago

Cant understand how to make url mask and syntax like [anyword+]

For example:
https://anything.com
Regular expression looks like that:
[a-z]*
But text mask undestand it like any 1 symbol. I need make any multiple symbols
mjurczyk commented 5 years ago

Proper regex for any URL is [-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/=]*). [a-z]* matches any sequence of characters from A-B, without any distinction.

mjurczyk commented 5 years ago

If you want to capture every character from a-z, use: (([a-z])*)