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