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
|
|
1307
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
255
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
46
|
|
23
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
54
|
|
24
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174401; |
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[569]| |
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{nl} = {"3263", "Aarlen", |
120
|
|
|
|
|
|
|
"3268", "Aat", |
121
|
|
|
|
|
|
|
"3219", "Borgworm", |
122
|
|
|
|
|
|
|
"322", "Brussel", |
123
|
|
|
|
|
|
|
"3210", "Waver", |
124
|
|
|
|
|
|
|
"323", "Antwerpen", |
125
|
|
|
|
|
|
|
"3243", "Luik", |
126
|
|
|
|
|
|
|
"3250", "Brugge", |
127
|
|
|
|
|
|
|
"3281", "Namen", |
128
|
|
|
|
|
|
|
"3265", "Bergen", |
129
|
|
|
|
|
|
|
"329", "Gent", |
130
|
|
|
|
|
|
|
"3269", "Doornik", |
131
|
|
|
|
|
|
|
"3285", "Hoei", |
132
|
|
|
|
|
|
|
"3257", "Ieper", |
133
|
|
|
|
|
|
|
"3242", "Luik", |
134
|
|
|
|
|
|
|
"3259", "Oostende", |
135
|
|
|
|
|
|
|
"3267", "Nijvel",}; |
136
|
|
|
|
|
|
|
$areanames{fr} = {"3216", "Louvain", |
137
|
|
|
|
|
|
|
"3259", "Ostende", |
138
|
|
|
|
|
|
|
"3251", "Roulers", |
139
|
|
|
|
|
|
|
"323", "Anvers", |
140
|
|
|
|
|
|
|
"3255", "Renaix", |
141
|
|
|
|
|
|
|
"3212", "Tongres", |
142
|
|
|
|
|
|
|
"329", "Gand", |
143
|
|
|
|
|
|
|
"3215", "Malines", |
144
|
|
|
|
|
|
|
"3252", "Termonde", |
145
|
|
|
|
|
|
|
"3256", "Courtrai", |
146
|
|
|
|
|
|
|
"3253", "Alost", |
147
|
|
|
|
|
|
|
"3258", "Furnes", |
148
|
|
|
|
|
|
|
"322", "Bruxelles",}; |
149
|
|
|
|
|
|
|
$areanames{de} = {"322", "Brüssel", |
150
|
|
|
|
|
|
|
"3263", "Arel", |
151
|
|
|
|
|
|
|
"3215", "Mecheln", |
152
|
|
|
|
|
|
|
"3212", "Tongern", |
153
|
|
|
|
|
|
|
"3265", "Bergen", |
154
|
|
|
|
|
|
|
"3281", "Namür", |
155
|
|
|
|
|
|
|
"329", "Gent", |
156
|
|
|
|
|
|
|
"323", "Antwerpen", |
157
|
|
|
|
|
|
|
"3243", "Lüttich", |
158
|
|
|
|
|
|
|
"3250", "Brügge", |
159
|
|
|
|
|
|
|
"3259", "Ostende", |
160
|
|
|
|
|
|
|
"3242", "Lüttich", |
161
|
|
|
|
|
|
|
"3257", "Ypern", |
162
|
|
|
|
|
|
|
"3216", "Löwen", |
163
|
|
|
|
|
|
|
"3280", "Stablo",}; |
164
|
|
|
|
|
|
|
$areanames{en} = {"3258", "Veurne", |
165
|
|
|
|
|
|
|
"3253", "Aalst", |
166
|
|
|
|
|
|
|
"322", "Brussels", |
167
|
|
|
|
|
|
|
"3211", "Hasselt", |
168
|
|
|
|
|
|
|
"3282", "Dinant", |
169
|
|
|
|
|
|
|
"3219", "Waremme", |
170
|
|
|
|
|
|
|
"3256", "Kortrijk", |
171
|
|
|
|
|
|
|
"3263", "Arlon", |
172
|
|
|
|
|
|
|
"3284", "Marche\-en\-Famenne", |
173
|
|
|
|
|
|
|
"3268", "Ath", |
174
|
|
|
|
|
|
|
"3283", "Ciney", |
175
|
|
|
|
|
|
|
"3264", "La\ Louvière", |
176
|
|
|
|
|
|
|
"3252", "Dendermonde", |
177
|
|
|
|
|
|
|
"3210", "Wavre", |
178
|
|
|
|
|
|
|
"3254", "Ninove", |
179
|
|
|
|
|
|
|
"3286", "Durbuy", |
180
|
|
|
|
|
|
|
"3215", "Mechelen", |
181
|
|
|
|
|
|
|
"3265", "Mons", |
182
|
|
|
|
|
|
|
"3281", "Namur", |
183
|
|
|
|
|
|
|
"3260", "Chimay", |
184
|
|
|
|
|
|
|
"329", "Ghent", |
185
|
|
|
|
|
|
|
"3289", "Genk", |
186
|
|
|
|
|
|
|
"3212", "Tongeren", |
187
|
|
|
|
|
|
|
"3214", "Herentals", |
188
|
|
|
|
|
|
|
"3250", "Bruges", |
189
|
|
|
|
|
|
|
"3287", "Verviers", |
190
|
|
|
|
|
|
|
"3255", "Ronse", |
191
|
|
|
|
|
|
|
"323", "Antwerp", |
192
|
|
|
|
|
|
|
"3243", "Liège", |
193
|
|
|
|
|
|
|
"3213", "Diest", |
194
|
|
|
|
|
|
|
"3267", "Nivelles", |
195
|
|
|
|
|
|
|
"3251", "Roeselare", |
196
|
|
|
|
|
|
|
"3259", "Ostend", |
197
|
|
|
|
|
|
|
"3261", "Libramont\-Chevigny", |
198
|
|
|
|
|
|
|
"3285", "Huy", |
199
|
|
|
|
|
|
|
"3257", "Ypres", |
200
|
|
|
|
|
|
|
"3216", "Leuven", |
201
|
|
|
|
|
|
|
"3242", "Liège", |
202
|
|
|
|
|
|
|
"3280", "Stavelot", |
203
|
|
|
|
|
|
|
"3269", "Tournai", |
204
|
|
|
|
|
|
|
"3271", "Charleroi",}; |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub new { |
207
|
19
|
|
|
19
|
1
|
41
|
my $class = shift; |
208
|
19
|
|
|
|
|
40
|
my $number = shift; |
209
|
19
|
|
|
|
|
132
|
$number =~ s/(^\+32|\D)//g; |
210
|
19
|
|
|
|
|
111
|
my $self = bless({ country_code => '32', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
211
|
19
|
100
|
|
|
|
122
|
return $self if ($self->is_valid()); |
212
|
1
|
|
|
|
|
17
|
$number =~ s/^(?:0)//; |
213
|
1
|
|
|
|
|
12
|
$self = bless({ country_code => '32', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
214
|
1
|
50
|
|
|
|
4
|
return $self->is_valid() ? $self : undef; |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
1; |