UK Phone Number Validator v 1.0

Published
2013-10-09 08:55
Written by
johnff - member of the CiviCRM community - view blog guidelines

It's a beautiful day up here in Dalesbridge, with a low sun, rippling green grass, a bright blue sky, and rolling hills as far as the eye can see.

It's also a particularly beautiful day because Future First is proud to announce the public packaging and release of one of its extensions: UK Phone Number Validator 1.0.


The above shows an example of how it looks with some dummy data assigned. But why is it important?

Future First's member schools need to be able to contact their registered alumni to participate in events, mentoring, and presentations to their current students. But it's impossible to successfully automate SMS messages to invalid phone numbers. The UK Phone Number Validator helps by providing a list of invalid phone numbers along with easy functions to change or delete the data. It's ideally used after as many as possible have been fixed by automated data cleaning.

This is, naturally, only the beginning. In time hopefully it will have country specific settings, and customisable rules for what constitutes "broken". Clearer indications of how a phone number is broken are needed. And pagination would be a nice touch as well.

Thanks to the help of several members of the CiviSprint community (most notably Xavier, Coleman, Tim, and Capo). The team here really is fantastic, and celebrates every success. Without this culture it'd be easy for small tools and additions to get lost among the forest of bigger projects, with CiviHR, CiviBooking, and various payment extensions in range of imminent releases.

We hope this extension is useful to you, and delight in any feedback, either here or on the project's github page.

Filed under

Comments

Thanks for sharing.

Does it have some UK specific regex in there?

Nope.

It checks to see if the number starts with 0 and is 11 digits long. Anything else flags it as broken.

At the moment it is quite limited! But I intend to make it more specific, and add customisable options, such as showing only certain types of phone number, and allowing people to select if they want spaces to count as a problem or not.

If you have specific feature requests then please leave them here!

Sounds great, was about to install when I noticed it's at 4.2 level, which for a new extension surprised me .  Is that right? Do you plan to make a 4.3/4.4 version soon?

Andy

There are also valid 10 digit UK phone numbers. Not sure how common they are but certainly Northwich (01606) has a lot of them.

It definitely works on 4.2, 4.3, and 4.4.

I made a slight change to the algorithm by the way. It now checks for starting with a 0, having 11 characters excluding spaces, and any non numerical characters.

Hi John, or anyone else who might be able to help.

This is great - about to trial it on a site. I'm new to extensions. Can you tell me how I know what permissions are required to use this?

Thanks

Hey Katy,

You might want to try posting on http://civicrm.stackexchange.com/ where more people will see and be able to answer the question.