Phone Number Validation Function
Stephen MacLean
smaclean at madmansoft.com
Mon Sep 11 22:11:18 EDT 2017
Hi Bob,
Last year I released a sample library for base functions like this:
https://github.com/renegadesteve/rsIsValid <https://github.com/renegadesteve/rsIsValid>
You can use the LCS version, or build a widget library for your version of LC 9.
It does use RegEx, but you can Sean said, there are many ways to do what you are looking to do.
Since it seems that you are looking for consistency across you app, however you get there, it can be done in multiple ways. RegEx is a valid way to do.
As always, YMMV.
Best,
Steve MacLean
> On Sep 11, 2017, at 6:48 PM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> 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
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list