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