| 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::NL; | ||||||||||
| 20 | 3 | ▶ | use base qw(Number::Phone::StubCountry); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 3 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 3 | our $VERSION = 1.20260904101551; | |||||||||
| 26 | |||||||||||
| 27 | 3 | my $formatters = [ | |||||||||
| 28 | { | ||||||||||
| 29 | 'format' => '$1', | ||||||||||
| 30 | 'intl_format' => 'NA', | ||||||||||
| 31 | 'leading_digits' => ' | ||||||||||
| 32 | 1[238]| | ||||||||||
| 33 | [34] | ||||||||||
| 34 | ', | ||||||||||
| 35 | 'pattern' => '(\\d{4})' | ||||||||||
| 36 | }, | ||||||||||
| 37 | { | ||||||||||
| 38 | 'format' => '$1 $2', | ||||||||||
| 39 | 'intl_format' => 'NA', | ||||||||||
| 40 | 'leading_digits' => '14', | ||||||||||
| 41 | 'pattern' => '(\\d{2})(\\d{3,4})' | ||||||||||
| 42 | }, | ||||||||||
| 43 | { | ||||||||||
| 44 | 'format' => '$1', | ||||||||||
| 45 | 'intl_format' => 'NA', | ||||||||||
| 46 | 'leading_digits' => '1', | ||||||||||
| 47 | 'pattern' => '(\\d{6})' | ||||||||||
| 48 | }, | ||||||||||
| 49 | { | ||||||||||
| 50 | 'format' => '$1 $2', | ||||||||||
| 51 | 'leading_digits' => '[89]0', | ||||||||||
| 52 | 'national_rule' => '0$1', | ||||||||||
| 53 | 'pattern' => '(\\d{3})(\\d{4,7})' | ||||||||||
| 54 | }, | ||||||||||
| 55 | { | ||||||||||
| 56 | 'format' => '$1 $2', | ||||||||||
| 57 | 'leading_digits' => '66', | ||||||||||
| 58 | 'national_rule' => '0$1', | ||||||||||
| 59 | 'pattern' => '(\\d{2})(\\d{7})' | ||||||||||
| 60 | }, | ||||||||||
| 61 | { | ||||||||||
| 62 | 'format' => '$1 $2', | ||||||||||
| 63 | 'leading_digits' => '6', | ||||||||||
| 64 | 'national_rule' => '0$1', | ||||||||||
| 65 | 'pattern' => '(\\d)(\\d{8})' | ||||||||||
| 66 | }, | ||||||||||
| 67 | { | ||||||||||
| 68 | 'format' => '$1 $2 $3', | ||||||||||
| 69 | 'leading_digits' => ' | ||||||||||
| 70 | 1[16-8]| | ||||||||||
| 71 | 2[259]| | ||||||||||
| 72 | 3[124]| | ||||||||||
| 73 | 4[17-9]| | ||||||||||
| 74 | 5[124679] | ||||||||||
| 75 | ', | ||||||||||
| 76 | 'national_rule' => '0$1', | ||||||||||
| 77 | 'pattern' => '(\\d{3})(\\d{3})(\\d{3})' | ||||||||||
| 78 | }, | ||||||||||
| 79 | { | ||||||||||
| 80 | 'format' => '$1 $2 $3', | ||||||||||
| 81 | 'leading_digits' => ' | ||||||||||
| 82 | [1-578]| | ||||||||||
| 83 | 91 | ||||||||||
| 84 | ', | ||||||||||
| 85 | 'national_rule' => '0$1', | ||||||||||
| 86 | 'pattern' => '(\\d{2})(\\d{3})(\\d{4})' | ||||||||||
| 87 | }, | ||||||||||
| 88 | { | ||||||||||
| 89 | 'format' => '$1 $2 $3', | ||||||||||
| 90 | 'leading_digits' => '9', | ||||||||||
| 91 | 'national_rule' => '0$1', | ||||||||||
| 92 | 'pattern' => '(\\d{3})(\\d{3})(\\d{5})' | ||||||||||
| 93 | } | ||||||||||
| 94 | ]; | ||||||||||
| 95 | |||||||||||
| 96 | 3 | my $validators = { | |||||||||
| 97 | 'fixed_line' => ' | ||||||||||
| 98 | (?: | ||||||||||
| 99 | 1(?: | ||||||||||
| 100 | [035]\\d| | ||||||||||
| 101 | 1[13-578]| | ||||||||||
| 102 | 6[124-8]| | ||||||||||
| 103 | 7[24]| | ||||||||||
| 104 | 8[0-467] | ||||||||||
| 105 | )| | ||||||||||
| 106 | 2(?: | ||||||||||
| 107 | [0346]\\d| | ||||||||||
| 108 | 2[2-46-9]| | ||||||||||
| 109 | 5[125]| | ||||||||||
| 110 | 9[479] | ||||||||||
| 111 | )| | ||||||||||
| 112 | 3(?: | ||||||||||
| 113 | [03568]\\d| | ||||||||||
| 114 | 1[3-8]| | ||||||||||
| 115 | 2[01]| | ||||||||||
| 116 | 4[1-8] | ||||||||||
| 117 | )| | ||||||||||
| 118 | 4(?: | ||||||||||
| 119 | [0356]\\d| | ||||||||||
| 120 | 1[1-368]| | ||||||||||
| 121 | 7[58]| | ||||||||||
| 122 | 8[15-8]| | ||||||||||
| 123 | 9[23579] | ||||||||||
| 124 | )| | ||||||||||
| 125 | 5(?: | ||||||||||
| 126 | [0358]\\d| | ||||||||||
| 127 | [19][1-9]| | ||||||||||
| 128 | 2[1-57-9]| | ||||||||||
| 129 | 4[13-8]| | ||||||||||
| 130 | 6[126]| | ||||||||||
| 131 | 7[0-3578] | ||||||||||
| 132 | )| | ||||||||||
| 133 | 7\\d\\d | ||||||||||
| 134 | )\\d{6} | ||||||||||
| 135 | ', | ||||||||||
| 136 | 'geographic' => ' | ||||||||||
| 137 | (?: | ||||||||||
| 138 | 1(?: | ||||||||||
| 139 | [035]\\d| | ||||||||||
| 140 | 1[13-578]| | ||||||||||
| 141 | 6[124-8]| | ||||||||||
| 142 | 7[24]| | ||||||||||
| 143 | 8[0-467] | ||||||||||
| 144 | )| | ||||||||||
| 145 | 2(?: | ||||||||||
| 146 | [0346]\\d| | ||||||||||
| 147 | 2[2-46-9]| | ||||||||||
| 148 | 5[125]| | ||||||||||
| 149 | 9[479] | ||||||||||
| 150 | )| | ||||||||||
| 151 | 3(?: | ||||||||||
| 152 | [03568]\\d| | ||||||||||
| 153 | 1[3-8]| | ||||||||||
| 154 | 2[01]| | ||||||||||
| 155 | 4[1-8] | ||||||||||
| 156 | )| | ||||||||||
| 157 | 4(?: | ||||||||||
| 158 | [0356]\\d| | ||||||||||
| 159 | 1[1-368]| | ||||||||||
| 160 | 7[58]| | ||||||||||
| 161 | 8[15-8]| | ||||||||||
| 162 | 9[23579] | ||||||||||
| 163 | )| | ||||||||||
| 164 | 5(?: | ||||||||||
| 165 | [0358]\\d| | ||||||||||
| 166 | [19][1-9]| | ||||||||||
| 167 | 2[1-57-9]| | ||||||||||
| 168 | 4[13-8]| | ||||||||||
| 169 | 6[126]| | ||||||||||
| 170 | 7[0-3578] | ||||||||||
| 171 | )| | ||||||||||
| 172 | 7\\d\\d | ||||||||||
| 173 | )\\d{6} | ||||||||||
| 174 | ', | ||||||||||
| 175 | 'mobile' => ' | ||||||||||
| 176 | (?: | ||||||||||
| 177 | 6[1-58]| | ||||||||||
| 178 | 970\\d | ||||||||||
| 179 | )\\d{7} | ||||||||||
| 180 | ', | ||||||||||
| 181 | 'pager' => '66\\d{7}', | ||||||||||
| 182 | 'personal_number' => '', | ||||||||||
| 183 | 'specialrate' => '(90[069]\\d{4,7})|( | ||||||||||
| 184 | 140(?: | ||||||||||
| 185 | 1[035]| | ||||||||||
| 186 | 2[0346]| | ||||||||||
| 187 | 3[03568]| | ||||||||||
| 188 | 4[0356]| | ||||||||||
| 189 | 5[0358]| | ||||||||||
| 190 | 8[458] | ||||||||||
| 191 | )| | ||||||||||
| 192 | (?: | ||||||||||
| 193 | 140(?: | ||||||||||
| 194 | 1[16-8]| | ||||||||||
| 195 | 2[259]| | ||||||||||
| 196 | 3[124]| | ||||||||||
| 197 | 4[17-9]| | ||||||||||
| 198 | 5[124679]| | ||||||||||
| 199 | 7 | ||||||||||
| 200 | )| | ||||||||||
| 201 | 8[478]\\d{6} | ||||||||||
| 202 | )\\d | ||||||||||
| 203 | )', | ||||||||||
| 204 | 'toll_free' => '800\\d{4,7}', | ||||||||||
| 205 | 'voip' => ' | ||||||||||
| 206 | (?: | ||||||||||
| 207 | 85| | ||||||||||
| 208 | 91 | ||||||||||
| 209 | )\\d{7} | ||||||||||
| 210 | ' | ||||||||||
| 211 | }; | ||||||||||
| 212 | 3 | my %areanames = (); | |||||||||
| 213 | 3 | $areanames{nl} = {"31486", "Schaijk", | |||||||||
| 214 | "3170", "Den\ Haag", | ||||||||||
| 215 | "31229", "Hoorn", | ||||||||||
| 216 | "31481", "Elst",}; | ||||||||||
| 217 | 3 | $areanames{en} = {"31561", "Wolvega", | |||||||||
| 218 | "31316", "Zevenaar", | ||||||||||
| 219 | "3133", "Amersfoort", | ||||||||||
| 220 | "31548", "Rijssen", | ||||||||||
| 221 | "31499", "Best", | ||||||||||
| 222 | "3123", "Haarlem", | ||||||||||
| 223 | "31320", "Lelystad", | ||||||||||
| 224 | "31346", "Maarssen", | ||||||||||
| 225 | "31165", "Roosendaal", | ||||||||||
| 226 | "31518", "St\.\ Annaparochie", | ||||||||||
| 227 | "31255", "IJmuiden", | ||||||||||
| 228 | "31545", "Eibergen", | ||||||||||
| 229 | "31111", "Zierikzee", | ||||||||||
| 230 | "31497", "Eersel", | ||||||||||
| 231 | "31594", "Zuidhorn", | ||||||||||
| 232 | "31524", "Coevorden", | ||||||||||
| 233 | "31592", "Assen", | ||||||||||
| 234 | "31168", "Zevenbergen", | ||||||||||
| 235 | "31522", "Meppel", | ||||||||||
| 236 | "31117", "Oostburg", | ||||||||||
| 237 | "31515", "Sneek", | ||||||||||
| 238 | "31523", "Hardenberg", | ||||||||||
| 239 | "31593", "Beilen", | ||||||||||
| 240 | "31252", "Nieuw\-Vennep", | ||||||||||
| 241 | "31543", "Winterswijk", | ||||||||||
| 242 | "3176", "Breda", | ||||||||||
| 243 | "31514", "Lemmer", | ||||||||||
| 244 | "31512", "Drachten", | ||||||||||
| 245 | "31411", "Boxtel", | ||||||||||
| 246 | "31525", "Elburg", | ||||||||||
| 247 | "31595", "Warffum", | ||||||||||
| 248 | "31513", "Heerenveen", | ||||||||||
| 249 | "31544", "Lichtenvoorde", | ||||||||||
| 250 | "31164", "Bergen\ op\ Zoom", | ||||||||||
| 251 | "31226", "Noord\ Scharwoude", | ||||||||||
| 252 | "31162", "Oosterhout", | ||||||||||
| 253 | "31598", "Veendam", | ||||||||||
| 254 | "31528", "Hoogeveen", | ||||||||||
| 255 | "31345", "Culemborg", | ||||||||||
| 256 | "31571", "Twello", | ||||||||||
| 257 | "31166", "Tholen", | ||||||||||
| 258 | "31223", "Den\ Helder", | ||||||||||
| 259 | "31222", "Den\ Burg", | ||||||||||
| 260 | "31315", "Terborg", | ||||||||||
| 261 | "31224", "Schagen", | ||||||||||
| 262 | "31294", "Weesp", | ||||||||||
| 263 | "31577", "Elspeet", | ||||||||||
| 264 | "3115", "Delft", | ||||||||||
| 265 | "3126", "Arnhem", | ||||||||||
| 266 | "31181", "Spijkenisse", | ||||||||||
| 267 | "31348", "Woerden", | ||||||||||
| 268 | "3153", "Enschede", | ||||||||||
| 269 | "31516", "Oosterwolde", | ||||||||||
| 270 | "31187", "Middelharnis", | ||||||||||
| 271 | "3136", "Almere", | ||||||||||
| 272 | "31318", "Veenendaal", | ||||||||||
| 273 | "3110", "Rotterdam", | ||||||||||
| 274 | "31546", "Almelo", | ||||||||||
| 275 | "31228", "Enkhuizen", | ||||||||||
| 276 | "3140", "Eindhoven", | ||||||||||
| 277 | "31478", "Venray", | ||||||||||
| 278 | "3177", "Venlo", | ||||||||||
| 279 | "31487", "Druten", | ||||||||||
| 280 | "31596", "Delfzijl", | ||||||||||
| 281 | "31481", "Bemmel", | ||||||||||
| 282 | "31475", "Roermond", | ||||||||||
| 283 | "3145", "Heerlen", | ||||||||||
| 284 | "31174", "Naaldwijk", | ||||||||||
| 285 | "31342", "Barneveld", | ||||||||||
| 286 | "31343", "Driebergen\-Rijsenburg", | ||||||||||
| 287 | "31314", "Doetinchem", | ||||||||||
| 288 | "31313", "Dieren", | ||||||||||
| 289 | "31344", "Tiel", | ||||||||||
| 290 | "3173", "\'s\-Hertogenbosch", | ||||||||||
| 291 | "31172", "Alphen\ aan\ den\ Rijn", | ||||||||||
| 292 | "31183", "Gorinchem", | ||||||||||
| 293 | "31416", "Waalwijk", | ||||||||||
| 294 | "31182", "Gouda", | ||||||||||
| 295 | "3143", "Maastricht", | ||||||||||
| 296 | "31485", "Cuyk", | ||||||||||
| 297 | "3175", "Zaandam", | ||||||||||
| 298 | "31299", "Purmerend", | ||||||||||
| 299 | "31184", "Sliedrecht", | ||||||||||
| 300 | "31229", "Horn", | ||||||||||
| 301 | "31572", "Raalte", | ||||||||||
| 302 | "31573", "Lochem", | ||||||||||
| 303 | "3170", "The\ Hague", | ||||||||||
| 304 | "31321", "Dronten", | ||||||||||
| 305 | "31227", "Medemblik", | ||||||||||
| 306 | "31297", "Aalsmeer", | ||||||||||
| 307 | "31488", "Zetten", | ||||||||||
| 308 | "3178", "Dordrecht", | ||||||||||
| 309 | "31575", "Zutphen", | ||||||||||
| 310 | "31341", "Harderwijk", | ||||||||||
| 311 | "3155", "Apeldoorn", | ||||||||||
| 312 | "3124", "Nijmegen", | ||||||||||
| 313 | "31317", "Wageningen", | ||||||||||
| 314 | "31566", "Grou", | ||||||||||
| 315 | "31347", "Vianen", | ||||||||||
| 316 | "3150", "Groningen", | ||||||||||
| 317 | "3158", "Leeuwarden", | ||||||||||
| 318 | "31578", "Epe", | ||||||||||
| 319 | "3113", "Tilburg", | ||||||||||
| 320 | "31113", "Goes", | ||||||||||
| 321 | "31180", "Barendrecht", | ||||||||||
| 322 | "31597", "Winschoten", | ||||||||||
| 323 | "31486", "Grave", | ||||||||||
| 324 | "31527", "Emmeloord", | ||||||||||
| 325 | "31521", "Steenwijk", | ||||||||||
| 326 | "31591", "Emmen", | ||||||||||
| 327 | "31492", "Helmond", | ||||||||||
| 328 | "31114", "Hulst", | ||||||||||
| 329 | "31493", "Deurne", | ||||||||||
| 330 | "31562", "West\-Terschelling", | ||||||||||
| 331 | "31529", "Dalfsen", | ||||||||||
| 332 | "31599", "Stadskanaal", | ||||||||||
| 333 | "3174", "Hengelo", | ||||||||||
| 334 | "31570", "Deventer", | ||||||||||
| 335 | "3146", "Sittard", | ||||||||||
| 336 | "31418", "Zaltbommel", | ||||||||||
| 337 | "3171", "Leiden", | ||||||||||
| 338 | "3130", "Utrecht", | ||||||||||
| 339 | "31167", "Steenbergen", | ||||||||||
| 340 | "31118", "Middelburg", | ||||||||||
| 341 | "31519", "Dokkum", | ||||||||||
| 342 | "3138", "Zwolle", | ||||||||||
| 343 | "3179", "Zoetermeer", | ||||||||||
| 344 | "3120", "Amsterdam", | ||||||||||
| 345 | "3172", "Alkmaar", | ||||||||||
| 346 | "31161", "Rijen", | ||||||||||
| 347 | "3135", "Hilversum", | ||||||||||
| 348 | "31541", "Oldenzaal", | ||||||||||
| 349 | "31251", "Beverwijk", | ||||||||||
| 350 | "31517", "Harlingen", | ||||||||||
| 351 | "31115", "Terneuzen", | ||||||||||
| 352 | "31511", "Veenwouden", | ||||||||||
| 353 | "31495", "Weert", | ||||||||||
| 354 | "31186", "Oud\-Beijerland", | ||||||||||
| 355 | "31412", "Oss", | ||||||||||
| 356 | "31413", "Uden", | ||||||||||
| 357 | "31547", "Goor",}; | ||||||||||
| 358 | 3 | my $timezones = { | |||||||||
| 359 | '' => [ | ||||||||||
| 360 | 'Europe/Amsterdam' | ||||||||||
| 361 | ] | ||||||||||
| 362 | }; | ||||||||||
| 363 | |||||||||||
| 364 | 30 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 365 | 30 | my $class = shift; | |||||||||
| 366 | 30 | my $number = shift; | |||||||||
| 367 | 30 | $number =~ s/(^\+31|\D)//g; | |||||||||
| 368 | 30 | my $self = bless({ country_code => '31', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 369 | 30 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 370 | 5 | $number =~ s/^(?:0)//; | |||||||||
| 371 | 5 | $self = bless({ country_code => '31', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 372 | 5 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 373 | } | ||||||||||
| 374 | 3 | 1; | |||||||||