line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 David Cantrell, derived from data from libphonenumber |
6
|
|
|
|
|
|
|
# http://code.google.com/p/libphonenumber/ |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
9
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
10
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
15
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
16
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
18
|
|
|
|
|
|
|
# limitations under the License. |
19
|
|
|
|
|
|
|
package Number::Phone::StubCountry::LY; |
20
|
2
|
|
|
2
|
|
1262
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
238
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
17
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
48
|
|
23
|
2
|
|
|
2
|
|
19
|
use warnings; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
59
|
|
24
|
2
|
|
|
2
|
|
18
|
use utf8; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
19
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
30
|
|
|
|
|
|
|
'leading_digits' => '[2-9]', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{7})' |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
]; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $validators = { |
37
|
|
|
|
|
|
|
'fixed_line' => ' |
38
|
|
|
|
|
|
|
(?: |
39
|
|
|
|
|
|
|
2(?: |
40
|
|
|
|
|
|
|
0[56]| |
41
|
|
|
|
|
|
|
[1-6]\\d| |
42
|
|
|
|
|
|
|
7[124579]| |
43
|
|
|
|
|
|
|
8[124] |
44
|
|
|
|
|
|
|
)| |
45
|
|
|
|
|
|
|
3(?: |
46
|
|
|
|
|
|
|
1\\d| |
47
|
|
|
|
|
|
|
2[2356] |
48
|
|
|
|
|
|
|
)| |
49
|
|
|
|
|
|
|
4(?: |
50
|
|
|
|
|
|
|
[17]\\d| |
51
|
|
|
|
|
|
|
2[1-357]| |
52
|
|
|
|
|
|
|
5[2-4]| |
53
|
|
|
|
|
|
|
8[124] |
54
|
|
|
|
|
|
|
)| |
55
|
|
|
|
|
|
|
5(?: |
56
|
|
|
|
|
|
|
[1347]\\d| |
57
|
|
|
|
|
|
|
2[1-469]| |
58
|
|
|
|
|
|
|
5[13-5]| |
59
|
|
|
|
|
|
|
8[1-4] |
60
|
|
|
|
|
|
|
)| |
61
|
|
|
|
|
|
|
6(?: |
62
|
|
|
|
|
|
|
[1-479]\\d| |
63
|
|
|
|
|
|
|
5[2-57]| |
64
|
|
|
|
|
|
|
8[1-5] |
65
|
|
|
|
|
|
|
)| |
66
|
|
|
|
|
|
|
7(?: |
67
|
|
|
|
|
|
|
[13]\\d| |
68
|
|
|
|
|
|
|
2[13-79] |
69
|
|
|
|
|
|
|
)| |
70
|
|
|
|
|
|
|
8(?: |
71
|
|
|
|
|
|
|
[124]\\d| |
72
|
|
|
|
|
|
|
5[124]| |
73
|
|
|
|
|
|
|
84 |
74
|
|
|
|
|
|
|
) |
75
|
|
|
|
|
|
|
)\\d{6} |
76
|
|
|
|
|
|
|
', |
77
|
|
|
|
|
|
|
'geographic' => ' |
78
|
|
|
|
|
|
|
(?: |
79
|
|
|
|
|
|
|
2(?: |
80
|
|
|
|
|
|
|
0[56]| |
81
|
|
|
|
|
|
|
[1-6]\\d| |
82
|
|
|
|
|
|
|
7[124579]| |
83
|
|
|
|
|
|
|
8[124] |
84
|
|
|
|
|
|
|
)| |
85
|
|
|
|
|
|
|
3(?: |
86
|
|
|
|
|
|
|
1\\d| |
87
|
|
|
|
|
|
|
2[2356] |
88
|
|
|
|
|
|
|
)| |
89
|
|
|
|
|
|
|
4(?: |
90
|
|
|
|
|
|
|
[17]\\d| |
91
|
|
|
|
|
|
|
2[1-357]| |
92
|
|
|
|
|
|
|
5[2-4]| |
93
|
|
|
|
|
|
|
8[124] |
94
|
|
|
|
|
|
|
)| |
95
|
|
|
|
|
|
|
5(?: |
96
|
|
|
|
|
|
|
[1347]\\d| |
97
|
|
|
|
|
|
|
2[1-469]| |
98
|
|
|
|
|
|
|
5[13-5]| |
99
|
|
|
|
|
|
|
8[1-4] |
100
|
|
|
|
|
|
|
)| |
101
|
|
|
|
|
|
|
6(?: |
102
|
|
|
|
|
|
|
[1-479]\\d| |
103
|
|
|
|
|
|
|
5[2-57]| |
104
|
|
|
|
|
|
|
8[1-5] |
105
|
|
|
|
|
|
|
)| |
106
|
|
|
|
|
|
|
7(?: |
107
|
|
|
|
|
|
|
[13]\\d| |
108
|
|
|
|
|
|
|
2[13-79] |
109
|
|
|
|
|
|
|
)| |
110
|
|
|
|
|
|
|
8(?: |
111
|
|
|
|
|
|
|
[124]\\d| |
112
|
|
|
|
|
|
|
5[124]| |
113
|
|
|
|
|
|
|
84 |
114
|
|
|
|
|
|
|
) |
115
|
|
|
|
|
|
|
)\\d{6} |
116
|
|
|
|
|
|
|
', |
117
|
|
|
|
|
|
|
'mobile' => '9[1-6]\\d{7}', |
118
|
|
|
|
|
|
|
'pager' => '', |
119
|
|
|
|
|
|
|
'personal_number' => '', |
120
|
|
|
|
|
|
|
'specialrate' => '', |
121
|
|
|
|
|
|
|
'toll_free' => '', |
122
|
|
|
|
|
|
|
'voip' => '' |
123
|
|
|
|
|
|
|
}; |
124
|
|
|
|
|
|
|
my %areanames = (); |
125
|
|
|
|
|
|
|
$areanames{en} = {"21841", "Garian", |
126
|
|
|
|
|
|
|
"218555", "Noflia", |
127
|
|
|
|
|
|
|
"21822", "Ben\ Gashir", |
128
|
|
|
|
|
|
|
"218224", "Swajni", |
129
|
|
|
|
|
|
|
"218581", "Wodan", |
130
|
|
|
|
|
|
|
"218582", "Sokna", |
131
|
|
|
|
|
|
|
"218427", "Kikla", |
132
|
|
|
|
|
|
|
"218206", "Suk\ Elkhamis", |
133
|
|
|
|
|
|
|
"218453", "Reyana", |
134
|
|
|
|
|
|
|
"21831", "Khums", |
135
|
|
|
|
|
|
|
"218481", "Kabaw", |
136
|
|
|
|
|
|
|
"218654", "Sidi\ Sultan\ Sultan", |
137
|
|
|
|
|
|
|
"21871", "Sebha", |
138
|
|
|
|
|
|
|
"218482", "Tigi", |
139
|
|
|
|
|
|
|
"218553", "Abuhadi", |
140
|
|
|
|
|
|
|
"21888", "Jaghbub", |
141
|
|
|
|
|
|
|
"218274", "Abu\ Issa", |
142
|
|
|
|
|
|
|
"218529", "Bugrain", |
143
|
|
|
|
|
|
|
"218252", "Zahra", |
144
|
|
|
|
|
|
|
"218727", "Zawaya", |
145
|
|
|
|
|
|
|
"218626", "Kaalifa", |
146
|
|
|
|
|
|
|
"21851", "Misratah", |
147
|
|
|
|
|
|
|
"218733", "Garda", |
148
|
|
|
|
|
|
|
"21863", "Benina", |
149
|
|
|
|
|
|
|
"21884", "El\ Beida", |
150
|
|
|
|
|
|
|
"218729", "Ghrefa", |
151
|
|
|
|
|
|
|
"218523", "Dafnia", |
152
|
|
|
|
|
|
|
"218325", "Tarhuna", |
153
|
|
|
|
|
|
|
"218624", "Elkuwaifia", |
154
|
|
|
|
|
|
|
"218723", "Edry", |
155
|
|
|
|
|
|
|
"21854", "Sirt", |
156
|
|
|
|
|
|
|
"218683", "Taknes", |
157
|
|
|
|
|
|
|
"21881", "Derna", |
158
|
|
|
|
|
|
|
"218584", "Zella", |
159
|
|
|
|
|
|
|
"218425", "Buzayan", |
160
|
|
|
|
|
|
|
"218272", "Azizia", |
161
|
|
|
|
|
|
|
"21823", "Zawia", |
162
|
|
|
|
|
|
|
"21825", "Zuara", |
163
|
|
|
|
|
|
|
"218271", "Hashan", |
164
|
|
|
|
|
|
|
"21867", "Elmareg", |
165
|
|
|
|
|
|
|
"218323", "Wadi\ Keam", |
166
|
|
|
|
|
|
|
"218652", "Kofra", |
167
|
|
|
|
|
|
|
"218484", "Ghadames", |
168
|
|
|
|
|
|
|
"218423", "Guassem", |
169
|
|
|
|
|
|
|
"218685", "Tomina", |
170
|
|
|
|
|
|
|
"218725", "Murzuk", |
171
|
|
|
|
|
|
|
"218627", "Jerdina", |
172
|
|
|
|
|
|
|
"218554", "Wadi\ Jeref", |
173
|
|
|
|
|
|
|
"218726", "Um\ Laranib", |
174
|
|
|
|
|
|
|
"218653", "Ojla", |
175
|
|
|
|
|
|
|
"21873", "Ubary", |
176
|
|
|
|
|
|
|
"218629", "Elmagrun", |
177
|
|
|
|
|
|
|
"218322", "Bani\ Walid", |
178
|
|
|
|
|
|
|
"218628", "Seluk", |
179
|
|
|
|
|
|
|
"218421", "Yefren", |
180
|
|
|
|
|
|
|
"218526", "Zawyat\ Elmahjub", |
181
|
|
|
|
|
|
|
"21861", "Benghazi", |
182
|
|
|
|
|
|
|
"218422", "Mizda", |
183
|
|
|
|
|
|
|
"218734", "Traghen", |
184
|
|
|
|
|
|
|
"21882", "Haraua", |
185
|
|
|
|
|
|
|
"218851", "Shahat", |
186
|
|
|
|
|
|
|
"218284", "Hugialin", |
187
|
|
|
|
|
|
|
"218521", "Zliten", |
188
|
|
|
|
|
|
|
"218522", "Tawergha", |
189
|
|
|
|
|
|
|
"218655", "Bisher", |
190
|
|
|
|
|
|
|
"218852", "Massa", |
191
|
|
|
|
|
|
|
"218275", "Matred", |
192
|
|
|
|
|
|
|
"21824", "Sabratha", |
193
|
|
|
|
|
|
|
"218721", "Brak", |
194
|
|
|
|
|
|
|
"218681", "Tolmitha", |
195
|
|
|
|
|
|
|
"218454", "Al\ Josh", |
196
|
|
|
|
|
|
|
"218682", "Jardas", |
197
|
|
|
|
|
|
|
"218326", "Kussabat", |
198
|
|
|
|
|
|
|
"218551", "Sirt", |
199
|
|
|
|
|
|
|
"21857", "Hun", |
200
|
|
|
|
|
|
|
"218821", "Gubba", |
201
|
|
|
|
|
|
|
"21821", "Tripoli", |
202
|
|
|
|
|
|
|
"218625", "Deriana", |
203
|
|
|
|
|
|
|
"218731", "Wadi\ Atba", |
204
|
|
|
|
|
|
|
"218732", "Bergen", |
205
|
|
|
|
|
|
|
"218623", "Gmines", |
206
|
|
|
|
|
|
|
"218277", "Mamura", |
207
|
|
|
|
|
|
|
"218205", "Sidiessaiah", |
208
|
|
|
|
|
|
|
"21826", "Taigura", |
209
|
|
|
|
|
|
|
"218282", "Agelat\,\ Ajalat", |
210
|
|
|
|
|
|
|
"218279", "Elmaya", |
211
|
|
|
|
|
|
|
"218854", "Slenta", |
212
|
|
|
|
|
|
|
"218281", "Jmail", |
213
|
|
|
|
|
|
|
"218524", "Kasarahmad", |
214
|
|
|
|
|
|
|
"218657", "Jalo", |
215
|
|
|
|
|
|
|
"218583", "Soussa", |
216
|
|
|
|
|
|
|
"21847", "Nalut", |
217
|
|
|
|
|
|
|
"218452", "Rujban", |
218
|
|
|
|
|
|
|
"218724", "Ghat", |
219
|
|
|
|
|
|
|
"218684", "Elbayada",}; |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
sub new { |
222
|
7
|
|
|
7
|
1
|
25
|
my $class = shift; |
223
|
7
|
|
|
|
|
18
|
my $number = shift; |
224
|
7
|
|
|
|
|
46
|
$number =~ s/(^\+218|\D)//g; |
225
|
7
|
|
|
|
|
47
|
my $self = bless({ country_code => '218', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
226
|
7
|
100
|
|
|
|
38
|
return $self if ($self->is_valid()); |
227
|
1
|
|
|
|
|
4
|
$number =~ s/^(?:0)//; |
228
|
1
|
|
|
|
|
19
|
$self = bless({ country_code => '218', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
229
|
1
|
50
|
|
|
|
6
|
return $self->is_valid() ? $self : undef; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
1; |