| 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::HU; | ||||||||||
| 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.20260904101550; | |||||||||
| 26 | |||||||||||
| 27 | 2 | my $formatters = [ | |||||||||
| 28 | { | ||||||||||
| 29 | 'format' => '$1 $2 $3', | ||||||||||
| 30 | 'leading_digits' => '1', | ||||||||||
| 31 | 'national_rule' => '(06 $1)', | ||||||||||
| 32 | 'pattern' => '(\\d)(\\d{3})(\\d{4})' | ||||||||||
| 33 | }, | ||||||||||
| 34 | { | ||||||||||
| 35 | 'format' => '$1 $2 $3', | ||||||||||
| 36 | 'leading_digits' => ' | ||||||||||
| 37 | [27][2-9]| | ||||||||||
| 38 | 3[2-7]| | ||||||||||
| 39 | 4[24-9]| | ||||||||||
| 40 | 5[2-79]| | ||||||||||
| 41 | 6| | ||||||||||
| 42 | 8[2-57-9]| | ||||||||||
| 43 | 9[2-69] | ||||||||||
| 44 | ', | ||||||||||
| 45 | 'national_rule' => '(06 $1)', | ||||||||||
| 46 | 'pattern' => '(\\d{2})(\\d{3})(\\d{3})' | ||||||||||
| 47 | }, | ||||||||||
| 48 | { | ||||||||||
| 49 | 'format' => '$1 $2 $3', | ||||||||||
| 50 | 'leading_digits' => '[2-9]', | ||||||||||
| 51 | 'national_rule' => '06 $1', | ||||||||||
| 52 | 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})' | ||||||||||
| 53 | } | ||||||||||
| 54 | ]; | ||||||||||
| 55 | |||||||||||
| 56 | 2 | my $validators = { | |||||||||
| 57 | 'fixed_line' => ' | ||||||||||
| 58 | (?: | ||||||||||
| 59 | 1\\d| | ||||||||||
| 60 | [27][2-9]| | ||||||||||
| 61 | 3[2-7]| | ||||||||||
| 62 | 4[24-9]| | ||||||||||
| 63 | 5[2-79]| | ||||||||||
| 64 | 6[23689]| | ||||||||||
| 65 | 8[2-57-9]| | ||||||||||
| 66 | 9[2-69] | ||||||||||
| 67 | )\\d{6} | ||||||||||
| 68 | ', | ||||||||||
| 69 | 'geographic' => ' | ||||||||||
| 70 | (?: | ||||||||||
| 71 | 1\\d| | ||||||||||
| 72 | [27][2-9]| | ||||||||||
| 73 | 3[2-7]| | ||||||||||
| 74 | 4[24-9]| | ||||||||||
| 75 | 5[2-79]| | ||||||||||
| 76 | 6[23689]| | ||||||||||
| 77 | 8[2-57-9]| | ||||||||||
| 78 | 9[2-69] | ||||||||||
| 79 | )\\d{6} | ||||||||||
| 80 | ', | ||||||||||
| 81 | 'mobile' => ' | ||||||||||
| 82 | (?: | ||||||||||
| 83 | [257]0| | ||||||||||
| 84 | 3[01] | ||||||||||
| 85 | )\\d{7} | ||||||||||
| 86 | ', | ||||||||||
| 87 | 'pager' => '', | ||||||||||
| 88 | 'personal_number' => '', | ||||||||||
| 89 | 'specialrate' => '(9[01]\\d{6})|(38\\d{7})', | ||||||||||
| 90 | 'toll_free' => ' | ||||||||||
| 91 | (?: | ||||||||||
| 92 | [48]0\\d| | ||||||||||
| 93 | 680[29] | ||||||||||
| 94 | )\\d{5} | ||||||||||
| 95 | ', | ||||||||||
| 96 | 'voip' => '21\\d{7}' | ||||||||||
| 97 | }; | ||||||||||
| 98 | 2 | my %areanames = (); | |||||||||
| 99 | 2 | $areanames{hu} = {"3689", "Pápa", | |||||||||
| 100 | "3653", "Cegléd", | ||||||||||
| 101 | "3674", "Szekszárd", | ||||||||||
| 102 | "3682", "Kaposvár", | ||||||||||
| 103 | "3657", "Jászberény", | ||||||||||
| 104 | "3695", "Sárvár", | ||||||||||
| 105 | "3669", "Mohács", | ||||||||||
| 106 | "3673", "Szigetvár", | ||||||||||
| 107 | "3654", "Berettyóújfalu", | ||||||||||
| 108 | "3625", "Dunaújváros", | ||||||||||
| 109 | "3645", "Kisvárda", | ||||||||||
| 110 | "3628", "Gödöllő", | ||||||||||
| 111 | "3672", "Pécs", | ||||||||||
| 112 | "3684", "Siófok", | ||||||||||
| 113 | "3696", "Győr", | ||||||||||
| 114 | "3648", "Ózd", | ||||||||||
| 115 | "3678", "Kiskőrös", | ||||||||||
| 116 | "3637", "Gyöngyös", | ||||||||||
| 117 | "3627", "Vác", | ||||||||||
| 118 | "3642", "Nyíregyháza", | ||||||||||
| 119 | "3632", "Salgótarján", | ||||||||||
| 120 | "3649", "Mezőkövesd", | ||||||||||
| 121 | "3666", "Békéscsaba", | ||||||||||
| 122 | "3668", "Orosháza", | ||||||||||
| 123 | "3634", "Tatabánya", | ||||||||||
| 124 | "3688", "Veszprém", | ||||||||||
| 125 | "3676", "Kecskemét",}; | ||||||||||
| 126 | 2 | $areanames{en} = {"3679", "Baja", | |||||||||
| 127 | "3684", "Siofok", | ||||||||||
| 128 | "3672", "Pecs", | ||||||||||
| 129 | "3628", "Godollo", | ||||||||||
| 130 | "3648", "Ozd", | ||||||||||
| 131 | "3677", "Kiskunhalas", | ||||||||||
| 132 | "3696", "Gyor", | ||||||||||
| 133 | "3654", "Berettyoujfalu", | ||||||||||
| 134 | "3625", "Dunaujvaros", | ||||||||||
| 135 | "3673", "Szigetvar", | ||||||||||
| 136 | "3645", "Kisvarda", | ||||||||||
| 137 | "3635", "Balassagyarmat", | ||||||||||
| 138 | "3695", "Sarvar", | ||||||||||
| 139 | "3657", "Jaszbereny", | ||||||||||
| 140 | "3669", "Mohacs", | ||||||||||
| 141 | "3662", "Szeged", | ||||||||||
| 142 | "361", "Budapest", | ||||||||||
| 143 | "3659", "Karcag", | ||||||||||
| 144 | "3683", "Keszthely", | ||||||||||
| 145 | "3652", "Debrecen", | ||||||||||
| 146 | "3636", "Eger", | ||||||||||
| 147 | "3687", "Tapolca", | ||||||||||
| 148 | "3646", "Miskolc", | ||||||||||
| 149 | "3663", "Szentes", | ||||||||||
| 150 | "3682", "Kaposvar", | ||||||||||
| 151 | "3689", "Papa", | ||||||||||
| 152 | "3674", "Szekszard", | ||||||||||
| 153 | "3653", "Cegled", | ||||||||||
| 154 | "3626", "Szentendre", | ||||||||||
| 155 | "3634", "Tatabanya", | ||||||||||
| 156 | "3644", "Mátészalka", | ||||||||||
| 157 | "3692", "Zalaegerszeg", | ||||||||||
| 158 | "3699", "Sopron", | ||||||||||
| 159 | "3676", "Kecskemet", | ||||||||||
| 160 | "3688", "Veszprem", | ||||||||||
| 161 | "3624", "Szigetszentmiklós", | ||||||||||
| 162 | "3693", "Nagykanizsa", | ||||||||||
| 163 | "3668", "Oroshaza", | ||||||||||
| 164 | "3685", "Marcali", | ||||||||||
| 165 | "3656", "Szolnok", | ||||||||||
| 166 | "3666", "Bekescsaba", | ||||||||||
| 167 | "3623", "Biatorbágy", | ||||||||||
| 168 | "3675", "Paks", | ||||||||||
| 169 | "3633", "Esztergom", | ||||||||||
| 170 | "3637", "Gyongyos", | ||||||||||
| 171 | "3647", "Szerencs", | ||||||||||
| 172 | "3678", "Kiskoros", | ||||||||||
| 173 | "3622", "Székesfehérvár", | ||||||||||
| 174 | "3629", "Monor", | ||||||||||
| 175 | "3649", "Mezokovesd", | ||||||||||
| 176 | "3632", "Salgotarjan", | ||||||||||
| 177 | "3642", "Nyiregyhaza", | ||||||||||
| 178 | "3627", "Vac", | ||||||||||
| 179 | "3694", "Szombathely",}; | ||||||||||
| 180 | 2 | my $timezones = { | |||||||||
| 181 | '' => [ | ||||||||||
| 182 | 'Europe/Budapest' | ||||||||||
| 183 | ] | ||||||||||
| 184 | }; | ||||||||||
| 185 | |||||||||||
| 186 | 19 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 187 | 19 | my $class = shift; | |||||||||
| 188 | 19 | my $number = shift; | |||||||||
| 189 | 19 | $number =~ s/(^\+36|\D)//g; | |||||||||
| 190 | 19 | my $self = bless({ country_code => '36', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 191 | 19 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 192 | 1 | $number =~ s/^(?:06)//; | |||||||||
| 193 | 1 | $self = bless({ country_code => '36', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 194 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 195 | } | ||||||||||
| 196 | 2 | 1; | |||||||||