Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CRM/Phonenumbervalidator/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public static function getPhoneNumberRegexes() {
array('label' => 'Malaysian (national)', 'regex' => '^[03|0|01|011][0-9]{9}$'),
array('label' => 'Malaysian (international)', 'regex' => '^006[03|0|01|011][0-9]{9}$'),
),
'Nigeria' => array(
array('label' => 'Nigeria landlines (national)', 'regex' => '^[0-8]?[0-9][0-9]{5,7}$'), // area code is 1-2 digits, local number is 5-7 digits, two-digit area code can't start with 9.
array('label' => 'Nigeria mobiles (national)', 'regex' => '^0?[7-9][0-1][0-9]{8}$'), // leading zero is optional
array('label' => 'Nigeria landlines (international)', 'regex' => '^00234[0-8]?[0-9][0-9]{5,7}$'), // International calls can drop leading zero on one-digit area codes
array('label' => 'Nigeria mobiles (international)', 'regex' => '^00234[7-9][0-1][0-9]{8}$'),
),
'Norway' => array(
array('label' => 'Norwegian landlines (national)', 'regex' => '^[^4|9][0-9]{7}$'),
array('label' => 'Norwegian mobiles (national)', 'regex' => '^[4|9][0-9]{7}$'),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Phone-Number-Validator
A tool that allows you to easily correct invalid phone numbers.

Country phone numbers supported: Australia, Belgium, Britain, Denmark, France, Germany, Ireland, Malaysia, the Netherlands, Norway, North America, Poland, Spain, South Africa, Switzerland, Vanuatu.
Country phone numbers supported: Australia, Belgium, Britain, Denmark, France, Germany, Ireland, Malaysia, the Netherlands, Nigeria, Norway, North America, Poland, Spain, South Africa, Switzerland, Vanuatu.

To start using, install and go to http://{yoursite}/civicrm/phonenumbervalidator

Expand Down