Is there a DAL validator or some method of validation that is capable of accepting both international phone numbers and multiple common formats for US phone numbers? I've been attempting to use a combination of IS_EMPTY_OR(IS_MATCH(...)) with regexes from the S.O. question entitled "A comprehensive regex for phone number validation"; some solutions using that approach, based on regexes in that thread either permitted input that should not be permitted, or disallowed input that should be allowed. Would appreciate recommendations on how to accomplish phone number validation in compliance with the above requirements. Thanks!
Asked
Active
Viewed 420 times
0
-
possible duplicate of [A comprehensive regex for phone number validation](http://stackoverflow.com/questions/123559/a-comprehensive-regex-for-phone-number-validation) – Tony Sep 27 '14 at 19:02
-
@Tony - I referenced the answer you provided in my question, and stated that the solutions offered there weren't helping. Also, if possible, I'm looking for a web2py specific solution (i.e. using web2py's validators with its DAL). – Spokes Sep 27 '14 at 19:33
-
I'll retract my close vote, I read your question but didn't follow the links. Can I suggest that if you reference a SO question it's best not to hide it with general wording in the link :) – Tony Sep 27 '14 at 21:26
-
You might want to add *why* the other suggestions don't work for you. – Jongware Sep 27 '14 at 23:16
-
@Jongware - It would take too long to go over the issues for each method I've tried, but I edited the post to include a general explanation of why the thread didn't help. Either way, I'm hoping that there's some tried and tested web2py-specific solution that somebody can provide, and if that's the case, the regexes in that thread wouldn't really factor into the discussion. – Spokes Sep 27 '14 at 23:22