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
|
|
1240
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
227
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
26
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
55
|
|
23
|
2
|
|
|
2
|
|
21
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
10
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
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} = {"218521", "Zliten", |
126
|
|
|
|
|
|
|
"21854", "Sirt", |
127
|
|
|
|
|
|
|
"218484", "Ghadames", |
128
|
|
|
|
|
|
|
"21847", "Nalut", |
129
|
|
|
|
|
|
|
"218852", "Massa", |
130
|
|
|
|
|
|
|
"21888", "Jaghbub", |
131
|
|
|
|
|
|
|
"218281", "Jmail", |
132
|
|
|
|
|
|
|
"218654", "Sidi\ Sultan\ Sultan", |
133
|
|
|
|
|
|
|
"218322", "Bani\ Walid", |
134
|
|
|
|
|
|
|
"218724", "Ghat", |
135
|
|
|
|
|
|
|
"218627", "Jerdina", |
136
|
|
|
|
|
|
|
"218729", "Ghrefa", |
137
|
|
|
|
|
|
|
"218523", "Dafnia", |
138
|
|
|
|
|
|
|
"21821", "Tripoli", |
139
|
|
|
|
|
|
|
"218726", "Um\ Laranib", |
140
|
|
|
|
|
|
|
"21884", "El\ Beida", |
141
|
|
|
|
|
|
|
"21822", "Ben\ Gashir", |
142
|
|
|
|
|
|
|
"218821", "Gubba", |
143
|
|
|
|
|
|
|
"21873", "Ubary", |
144
|
|
|
|
|
|
|
"218482", "Tigi", |
145
|
|
|
|
|
|
|
"218628", "Seluk", |
146
|
|
|
|
|
|
|
"218854", "Slenta", |
147
|
|
|
|
|
|
|
"218652", "Kofra", |
148
|
|
|
|
|
|
|
"218623", "Gmines", |
149
|
|
|
|
|
|
|
"218625", "Deriana", |
150
|
|
|
|
|
|
|
"218206", "Suk\ Elkhamis", |
151
|
|
|
|
|
|
|
"218326", "Kussabat", |
152
|
|
|
|
|
|
|
"218554", "Wadi\ Jeref", |
153
|
|
|
|
|
|
|
"218425", "Buzayan", |
154
|
|
|
|
|
|
|
"218224", "Swajni", |
155
|
|
|
|
|
|
|
"218734", "Traghen", |
156
|
|
|
|
|
|
|
"218584", "Zella", |
157
|
|
|
|
|
|
|
"218421", "Yefren", |
158
|
|
|
|
|
|
|
"21857", "Hun", |
159
|
|
|
|
|
|
|
"218452", "Rujban", |
160
|
|
|
|
|
|
|
"218271", "Hashan", |
161
|
|
|
|
|
|
|
"218682", "Jardas", |
162
|
|
|
|
|
|
|
"218275", "Matred", |
163
|
|
|
|
|
|
|
"21871", "Sebha", |
164
|
|
|
|
|
|
|
"218423", "Guassem", |
165
|
|
|
|
|
|
|
"21823", "Zawia", |
166
|
|
|
|
|
|
|
"218277", "Mamura", |
167
|
|
|
|
|
|
|
"218732", "Bergen", |
168
|
|
|
|
|
|
|
"218582", "Sokna", |
169
|
|
|
|
|
|
|
"218454", "Al\ Josh", |
170
|
|
|
|
|
|
|
"218684", "Elbayada", |
171
|
|
|
|
|
|
|
"21867", "Elmareg", |
172
|
|
|
|
|
|
|
"21831", "Khums", |
173
|
|
|
|
|
|
|
"218427", "Kikla", |
174
|
|
|
|
|
|
|
"218284", "Hugialin", |
175
|
|
|
|
|
|
|
"218524", "Kasarahmad", |
176
|
|
|
|
|
|
|
"218481", "Kabaw", |
177
|
|
|
|
|
|
|
"218725", "Murzuk", |
178
|
|
|
|
|
|
|
"218655", "Bisher", |
179
|
|
|
|
|
|
|
"218721", "Brak", |
180
|
|
|
|
|
|
|
"21826", "Taigura", |
181
|
|
|
|
|
|
|
"218653", "Ojla", |
182
|
|
|
|
|
|
|
"218526", "Zawyat\ Elmahjub", |
183
|
|
|
|
|
|
|
"218723", "Edry", |
184
|
|
|
|
|
|
|
"21841", "Garian", |
185
|
|
|
|
|
|
|
"218529", "Bugrain", |
186
|
|
|
|
|
|
|
"218282", "Agelat\,\ Ajalat", |
187
|
|
|
|
|
|
|
"218851", "Shahat", |
188
|
|
|
|
|
|
|
"21825", "Zuara", |
189
|
|
|
|
|
|
|
"218325", "Tarhuna", |
190
|
|
|
|
|
|
|
"218205", "Sidiessaiah", |
191
|
|
|
|
|
|
|
"218522", "Tawergha", |
192
|
|
|
|
|
|
|
"218629", "Elmagrun", |
193
|
|
|
|
|
|
|
"21863", "Benina", |
194
|
|
|
|
|
|
|
"218626", "Kaalifa", |
195
|
|
|
|
|
|
|
"218553", "Abuhadi", |
196
|
|
|
|
|
|
|
"218555", "Noflia", |
197
|
|
|
|
|
|
|
"218657", "Jalo", |
198
|
|
|
|
|
|
|
"218323", "Wadi\ Keam", |
199
|
|
|
|
|
|
|
"218551", "Sirt", |
200
|
|
|
|
|
|
|
"218727", "Zawaya", |
201
|
|
|
|
|
|
|
"218624", "Elkuwaifia", |
202
|
|
|
|
|
|
|
"218581", "Wodan", |
203
|
|
|
|
|
|
|
"21881", "Derna", |
204
|
|
|
|
|
|
|
"218279", "Elmaya", |
205
|
|
|
|
|
|
|
"218731", "Wadi\ Atba", |
206
|
|
|
|
|
|
|
"21882", "Haraua", |
207
|
|
|
|
|
|
|
"21824", "Sabratha", |
208
|
|
|
|
|
|
|
"218252", "Zahra", |
209
|
|
|
|
|
|
|
"218274", "Abu\ Issa", |
210
|
|
|
|
|
|
|
"21851", "Misratah", |
211
|
|
|
|
|
|
|
"218733", "Garda", |
212
|
|
|
|
|
|
|
"218583", "Soussa", |
213
|
|
|
|
|
|
|
"218453", "Reyana", |
214
|
|
|
|
|
|
|
"218683", "Taknes", |
215
|
|
|
|
|
|
|
"218422", "Mizda", |
216
|
|
|
|
|
|
|
"21861", "Benghazi", |
217
|
|
|
|
|
|
|
"218681", "Tolmitha", |
218
|
|
|
|
|
|
|
"218272", "Azizia", |
219
|
|
|
|
|
|
|
"218685", "Tomina",}; |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
sub new { |
222
|
7
|
|
|
7
|
1
|
21
|
my $class = shift; |
223
|
7
|
|
|
|
|
15
|
my $number = shift; |
224
|
7
|
|
|
|
|
48
|
$number =~ s/(^\+218|\D)//g; |
225
|
7
|
|
|
|
|
41
|
my $self = bless({ country_code => '218', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
226
|
7
|
100
|
|
|
|
37
|
return $self if ($self->is_valid()); |
227
|
1
|
|
|
|
|
8
|
$number =~ s/^(?:0)//; |
228
|
1
|
|
|
|
|
14
|
$self = bless({ country_code => '218', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
229
|
1
|
50
|
|
|
|
7
|
return $self->is_valid() ? $self : undef; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
1; |