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::BE; |
20
|
2
|
|
|
2
|
|
1189
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
274
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
17
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
50
|
|
23
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
50
|
|
24
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
13
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131441; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
(?: |
32
|
|
|
|
|
|
|
80| |
33
|
|
|
|
|
|
|
9 |
34
|
|
|
|
|
|
|
)0 |
35
|
|
|
|
|
|
|
', |
36
|
|
|
|
|
|
|
'national_rule' => '0$1', |
37
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{2})(\\d{3})' |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
{ |
40
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
41
|
|
|
|
|
|
|
'leading_digits' => ' |
42
|
|
|
|
|
|
|
[239]| |
43
|
|
|
|
|
|
|
4[23] |
44
|
|
|
|
|
|
|
', |
45
|
|
|
|
|
|
|
'national_rule' => '0$1', |
46
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})' |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
50
|
|
|
|
|
|
|
'leading_digits' => '[15-8]', |
51
|
|
|
|
|
|
|
'national_rule' => '0$1', |
52
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})' |
53
|
|
|
|
|
|
|
}, |
54
|
|
|
|
|
|
|
{ |
55
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
56
|
|
|
|
|
|
|
'leading_digits' => '4', |
57
|
|
|
|
|
|
|
'national_rule' => '0$1', |
58
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})' |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
]; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my $validators = { |
63
|
|
|
|
|
|
|
'fixed_line' => ' |
64
|
|
|
|
|
|
|
80[2-8]\\d{5}| |
65
|
|
|
|
|
|
|
(?: |
66
|
|
|
|
|
|
|
1[0-69]| |
67
|
|
|
|
|
|
|
[23][2-8]| |
68
|
|
|
|
|
|
|
4[23]| |
69
|
|
|
|
|
|
|
5\\d| |
70
|
|
|
|
|
|
|
6[013-57-9]| |
71
|
|
|
|
|
|
|
71| |
72
|
|
|
|
|
|
|
8[1-79]| |
73
|
|
|
|
|
|
|
9[2-4] |
74
|
|
|
|
|
|
|
)\\d{6} |
75
|
|
|
|
|
|
|
', |
76
|
|
|
|
|
|
|
'geographic' => ' |
77
|
|
|
|
|
|
|
80[2-8]\\d{5}| |
78
|
|
|
|
|
|
|
(?: |
79
|
|
|
|
|
|
|
1[0-69]| |
80
|
|
|
|
|
|
|
[23][2-8]| |
81
|
|
|
|
|
|
|
4[23]| |
82
|
|
|
|
|
|
|
5\\d| |
83
|
|
|
|
|
|
|
6[013-57-9]| |
84
|
|
|
|
|
|
|
71| |
85
|
|
|
|
|
|
|
8[1-79]| |
86
|
|
|
|
|
|
|
9[2-4] |
87
|
|
|
|
|
|
|
)\\d{6} |
88
|
|
|
|
|
|
|
', |
89
|
|
|
|
|
|
|
'mobile' => '4[5-9]\\d{7}', |
90
|
|
|
|
|
|
|
'pager' => '', |
91
|
|
|
|
|
|
|
'personal_number' => '', |
92
|
|
|
|
|
|
|
'specialrate' => '(7879\\d{4})|( |
93
|
|
|
|
|
|
|
(?: |
94
|
|
|
|
|
|
|
70(?: |
95
|
|
|
|
|
|
|
2[0-57]| |
96
|
|
|
|
|
|
|
3[04-7]| |
97
|
|
|
|
|
|
|
44| |
98
|
|
|
|
|
|
|
6[4-69]| |
99
|
|
|
|
|
|
|
7[0579] |
100
|
|
|
|
|
|
|
)| |
101
|
|
|
|
|
|
|
90\\d\\d |
102
|
|
|
|
|
|
|
)\\d{4} |
103
|
|
|
|
|
|
|
)|( |
104
|
|
|
|
|
|
|
78(?: |
105
|
|
|
|
|
|
|
0[57]| |
106
|
|
|
|
|
|
|
1[014-8]| |
107
|
|
|
|
|
|
|
2[25]| |
108
|
|
|
|
|
|
|
3[15-8]| |
109
|
|
|
|
|
|
|
48| |
110
|
|
|
|
|
|
|
[56]0| |
111
|
|
|
|
|
|
|
7[06-8]| |
112
|
|
|
|
|
|
|
9\\d |
113
|
|
|
|
|
|
|
)\\d{4} |
114
|
|
|
|
|
|
|
)', |
115
|
|
|
|
|
|
|
'toll_free' => '800[1-9]\\d{4}', |
116
|
|
|
|
|
|
|
'voip' => '' |
117
|
|
|
|
|
|
|
}; |
118
|
|
|
|
|
|
|
my %areanames = (); |
119
|
|
|
|
|
|
|
$areanames{de} = {"329", "Gent", |
120
|
|
|
|
|
|
|
"3280", "Stablo", |
121
|
|
|
|
|
|
|
"3216", "Löwen", |
122
|
|
|
|
|
|
|
"3243", "Lüttich", |
123
|
|
|
|
|
|
|
"3281", "Namür", |
124
|
|
|
|
|
|
|
"3265", "Bergen", |
125
|
|
|
|
|
|
|
"3259", "Ostende", |
126
|
|
|
|
|
|
|
"323", "Antwerpen", |
127
|
|
|
|
|
|
|
"3257", "Ypern", |
128
|
|
|
|
|
|
|
"3250", "Brügge", |
129
|
|
|
|
|
|
|
"322", "Brüssel", |
130
|
|
|
|
|
|
|
"3242", "Lüttich", |
131
|
|
|
|
|
|
|
"3215", "Mecheln", |
132
|
|
|
|
|
|
|
"3212", "Tongern", |
133
|
|
|
|
|
|
|
"3263", "Arel",}; |
134
|
|
|
|
|
|
|
$areanames{fr} = {"3251", "Roulers", |
135
|
|
|
|
|
|
|
"3258", "Furnes", |
136
|
|
|
|
|
|
|
"3212", "Tongres", |
137
|
|
|
|
|
|
|
"3215", "Malines", |
138
|
|
|
|
|
|
|
"322", "Bruxelles", |
139
|
|
|
|
|
|
|
"3252", "Termonde", |
140
|
|
|
|
|
|
|
"323", "Anvers", |
141
|
|
|
|
|
|
|
"3255", "Renaix", |
142
|
|
|
|
|
|
|
"3256", "Courtrai", |
143
|
|
|
|
|
|
|
"3259", "Ostende", |
144
|
|
|
|
|
|
|
"3216", "Louvain", |
145
|
|
|
|
|
|
|
"3253", "Alost", |
146
|
|
|
|
|
|
|
"329", "Gand",}; |
147
|
|
|
|
|
|
|
$areanames{nl} = {"3268", "Aat", |
148
|
|
|
|
|
|
|
"3219", "Borgworm", |
149
|
|
|
|
|
|
|
"3285", "Hoei", |
150
|
|
|
|
|
|
|
"329", "Gent", |
151
|
|
|
|
|
|
|
"3267", "Nijvel", |
152
|
|
|
|
|
|
|
"3259", "Oostende", |
153
|
|
|
|
|
|
|
"3243", "Luik", |
154
|
|
|
|
|
|
|
"3281", "Namen", |
155
|
|
|
|
|
|
|
"3265", "Bergen", |
156
|
|
|
|
|
|
|
"3250", "Brugge", |
157
|
|
|
|
|
|
|
"3269", "Doornik", |
158
|
|
|
|
|
|
|
"3257", "Ieper", |
159
|
|
|
|
|
|
|
"323", "Antwerpen", |
160
|
|
|
|
|
|
|
"3210", "Waver", |
161
|
|
|
|
|
|
|
"3263", "Aarlen", |
162
|
|
|
|
|
|
|
"322", "Brussel", |
163
|
|
|
|
|
|
|
"3242", "Luik",}; |
164
|
|
|
|
|
|
|
$areanames{en} = {"3289", "Genk", |
165
|
|
|
|
|
|
|
"3215", "Mechelen", |
166
|
|
|
|
|
|
|
"3286", "Durbuy", |
167
|
|
|
|
|
|
|
"322", "Brussels", |
168
|
|
|
|
|
|
|
"3242", "Liège", |
169
|
|
|
|
|
|
|
"3210", "Wavre", |
170
|
|
|
|
|
|
|
"3251", "Roeselare", |
171
|
|
|
|
|
|
|
"3263", "Arlon", |
172
|
|
|
|
|
|
|
"3258", "Veurne", |
173
|
|
|
|
|
|
|
"3214", "Herentals", |
174
|
|
|
|
|
|
|
"3212", "Tongeren", |
175
|
|
|
|
|
|
|
"3283", "Ciney", |
176
|
|
|
|
|
|
|
"323", "Antwerp", |
177
|
|
|
|
|
|
|
"3255", "Ronse", |
178
|
|
|
|
|
|
|
"3211", "Hasselt", |
179
|
|
|
|
|
|
|
"3250", "Bruges", |
180
|
|
|
|
|
|
|
"3269", "Tournai", |
181
|
|
|
|
|
|
|
"3257", "Ypres", |
182
|
|
|
|
|
|
|
"3254", "Ninove", |
183
|
|
|
|
|
|
|
"3252", "Dendermonde", |
184
|
|
|
|
|
|
|
"3265", "Mons", |
185
|
|
|
|
|
|
|
"3281", "Namur", |
186
|
|
|
|
|
|
|
"3243", "Liège", |
187
|
|
|
|
|
|
|
"3256", "Kortrijk", |
188
|
|
|
|
|
|
|
"3264", "La\ Louvière", |
189
|
|
|
|
|
|
|
"3267", "Nivelles", |
190
|
|
|
|
|
|
|
"3271", "Charleroi", |
191
|
|
|
|
|
|
|
"3259", "Ostend", |
192
|
|
|
|
|
|
|
"3213", "Diest", |
193
|
|
|
|
|
|
|
"3260", "Chimay", |
194
|
|
|
|
|
|
|
"3282", "Dinant", |
195
|
|
|
|
|
|
|
"3287", "Verviers", |
196
|
|
|
|
|
|
|
"3284", "Marche\-en\-Famenne", |
197
|
|
|
|
|
|
|
"3280", "Stavelot", |
198
|
|
|
|
|
|
|
"329", "Ghent", |
199
|
|
|
|
|
|
|
"3216", "Leuven", |
200
|
|
|
|
|
|
|
"3268", "Ath", |
201
|
|
|
|
|
|
|
"3253", "Aalst", |
202
|
|
|
|
|
|
|
"3219", "Waremme", |
203
|
|
|
|
|
|
|
"3261", "Libramont\-Chevigny", |
204
|
|
|
|
|
|
|
"3285", "Huy",}; |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub new { |
207
|
19
|
|
|
19
|
1
|
51
|
my $class = shift; |
208
|
19
|
|
|
|
|
33
|
my $number = shift; |
209
|
19
|
|
|
|
|
121
|
$number =~ s/(^\+32|\D)//g; |
210
|
19
|
|
|
|
|
133
|
my $self = bless({ country_code => '32', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
211
|
19
|
100
|
|
|
|
82
|
return $self if ($self->is_valid()); |
212
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
213
|
1
|
|
|
|
|
13
|
$self = bless({ country_code => '32', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
214
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
1; |