Phone Number Validation Function

Bob Sneidar bobsneidar at iotecdigital.com
Mon Sep 11 18:48:25 EDT 2017


Thanks Sean, but reading through that article, I think it makes the arguement for NOT using RegEx, seeing all the arguments back and forth about what is wrong with each other's regex, and one guy pooh poohing all of them in favor of a procedural approach. 

My goal is not to simply allow certain characters and numbers (I have a function that does that already) of a given length, but to enforce data consistency across my apps. That means that while certain numbers are acceptably formatted phone numbers according to some international standard, having +1 at the beginning for example, I don't necessarily want that. Periods are valid delimiters, but I don't want that either. 

Now the google api looks promising, but if I have to tie it to a google account and active internet connection, I will probably stick to rolling my own. 

Bob S


> On Sep 11, 2017, at 15:33 , Sean Cole (Pi) via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Read this:
> https://stackoverflow.com/questions/123559/a-comprehensive-regex-for-phone-number-validation
> 
> You can then filter by these Regular Expressions (RegEx) really simply.
> More importantly, it is one or two lines of code instead of 53.
> 
> Sean Cole





More information about the use-livecode mailing list