rstudio / shinyvalidate

Input validation package for the Shiny web framework
https://rstudio.github.io/shinyvalidate/
Other
110 stars 8 forks source link

sv_functions I want #7

Open akgold opened 4 years ago

akgold commented 4 years ago

If these were added, I think it'd cover a large proportion of use cases.

Standard regexs for email + phone Checks for non-negative and strictly positive numbers

jcheng5 commented 4 years ago

URLs (http and https) too, maybe.

Phone numbers are complicated if you want to support multiple locales but looks like there's a dialr package which wraps Google's libphonenumber, looks promising.

rich-iannone commented 3 years ago

I had a look at dialr but there is a dependency on rJava which I think is undesirable. I was hoping to find an R port of libphonenumber-js but that is not a thing.

ismirsehregal commented 3 years ago

IPs would be great. Something like: https://rdrr.io/cran/iptools/src/R/is.R and valid filenames (e.g. for Windows) would be helpful.

D3SL commented 2 years ago

Full phone number validation isn't really feasible just because of the workload. Every country has their own formatting and often also legacy numbers that don't follow the current rules. The closest you could get I think would be requiring numbers start with a +, a recognized country code, and a fairly generous minimum and maximum length. Something like 5-15 digits inclusive of the country code (but not the leading +).