From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

# automatically generated file, don't edit
# Copyright 2024 David Cantrell, derived from data from libphonenumber
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use strict;
use utf8;
our $VERSION = 1.20250323211830;
my $formatters = [];
my $validators = {
'fixed_line' => '
(?:
[24]\\d|
3[1-9]|
50|
65(?:
02[12]|
12[56]|
22[89]|
[3-5]00
)|
7(?:
27\\d\\d|
3100|
5(?:
02[12]|
12[56]|
22[89]|
[34](?:
00|
81
)|
500
)
)|
8[0-5]
)\\d{3}
',
'geographic' => '
(?:
[24]\\d|
3[1-9]|
50|
65(?:
02[12]|
12[56]|
22[89]|
[3-5]00
)|
7(?:
27\\d\\d|
3100|
5(?:
02[12]|
12[56]|
22[89]|
[34](?:
00|
81
)|
500
)
)|
8[0-5]
)\\d{3}
',
'mobile' => '
(?:
6200[01]|
7(?:
310[1-9]|
5(?:
02[03-9]|
12[0-47-9]|
22[0-7]|
[34](?:
0[1-9]|
8[02-9]
)|
50[1-9]
)
)
)\\d{3}|
(?:
63\\d\\d|
7(?:
(?:
[0146-9]\\d|
2[0-689]
)\\d|
3(?:
[02-9]\\d|
1[1-9]
)|
5(?:
[0-2][013-9]|
[34][1-79]|
5[1-9]|
[6-9]\\d
)
)
)\\d{4}
',
'pager' => '',
'personal_number' => '',
'specialrate' => '',
'toll_free' => '',
'voip' => '
30(?:
0[01]\\d\\d|
12(?:
11|
20
)
)\\d\\d
'
};
my %areanames = ();
$areanames{en} = {"68642", "Nonouti",
"686653", "Gilbert\ Islands",
"686650", "Bairiki",
"68641", "Abemama",
"68672700", "Gilbert\ Islands",
"68675381", "Line\ Islands",
"68649", "Arorae",
"68638", "Maiana",
"68628", "Bikenibeu",
"68640", "Aranuka",
"68645", "Onotoa",
"68621", "Bairiki",
"68631", "North\ Tarawa",
"68682", "Kiritimati",
"68681", "Kiritimati",
"68675400", "Phoenix\ Islands",
"68632", "North\ Tarawa",
"68622", "Bairiki",
"686652", "Bikenibeu",
"68625", "Betio",
"686655", "Phoenix\ Islands",
"68675125", "Betio",
"68635", "Butaritari",
"68648", "Tamana",
"68639", "Kuria",
"68685", "Kanton",
"68675126", "Betio",
"68629", "Bikenibeu",
"68675500", "Phoenix\ Islands",
"686651", "Betio",
"68675021", "Bairiki",
"68637", "Banaba",
"68675481", "Line\ Islands",
"68626", "Betio",
"68636", "Makin",
"68627", "Tarawa",
"686654", "Gilbert\ Islands",
"68643", "Tabiteuea\ North",
"68644", "Tabiteuea\ South",
"68675229", "Bikenibeu",
"68675022", "Bairiki",
"68675228", "Bikenibeu",
"68634", "Marakei",
"68633", "Abaiang",
"68623", "Bairiki",
"68624", "Bairiki",
"68675300", "Gilbert\ Islands",
"68647", "Nikunau",
"68646", "Beru",
"68683", "Fanning",
"68684", "Washington",};
my $timezones = {
'' => [
'Pacific/Enderbury',
'Pacific/Kiritimati',
'Pacific/Tarawa'
]
};
sub new {
my $class = shift;
my $number = shift;
$number =~ s/(^\+686|\D)//g;
my $self = bless({ country_code => '686', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
return $self if ($self->is_valid());
$number =~ s/^(?:0)//;
$self = bless({ country_code => '686', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
return $self->is_valid() ? $self : undef;
}
1;