| 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::JO; | ||||||||||
| 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' => ' | ||||||||||
| 31 | [2356]| | ||||||||||
| 32 | 87 | ||||||||||
| 33 | ', | ||||||||||
| 34 | 'national_rule' => '(0$1)', | ||||||||||
| 35 | 'pattern' => '(\\d)(\\d{3})(\\d{4})' | ||||||||||
| 36 | }, | ||||||||||
| 37 | { | ||||||||||
| 38 | 'format' => '$1 $2', | ||||||||||
| 39 | 'leading_digits' => '[89]', | ||||||||||
| 40 | 'national_rule' => '0$1', | ||||||||||
| 41 | 'pattern' => '(\\d{3})(\\d{5,6})' | ||||||||||
| 42 | }, | ||||||||||
| 43 | { | ||||||||||
| 44 | 'format' => '$1 $2', | ||||||||||
| 45 | 'leading_digits' => '70', | ||||||||||
| 46 | 'national_rule' => '0$1', | ||||||||||
| 47 | 'pattern' => '(\\d{2})(\\d{7})' | ||||||||||
| 48 | }, | ||||||||||
| 49 | { | ||||||||||
| 50 | 'format' => '$1 $2 $3', | ||||||||||
| 51 | 'leading_digits' => '[47]', | ||||||||||
| 52 | 'national_rule' => '0$1', | ||||||||||
| 53 | 'pattern' => '(\\d)(\\d{4})(\\d{4})' | ||||||||||
| 54 | } | ||||||||||
| 55 | ]; | ||||||||||
| 56 | |||||||||||
| 57 | 2 | my $validators = { | |||||||||
| 58 | 'fixed_line' => ' | ||||||||||
| 59 | 87(?: | ||||||||||
| 60 | 000| | ||||||||||
| 61 | 90[01] | ||||||||||
| 62 | )\\d{3}| | ||||||||||
| 63 | (?: | ||||||||||
| 64 | 2(?: | ||||||||||
| 65 | 6(?: | ||||||||||
| 66 | 2[0-35-9]| | ||||||||||
| 67 | 3[0-578]| | ||||||||||
| 68 | 4[24-7]| | ||||||||||
| 69 | 5[0-24-8]| | ||||||||||
| 70 | [6-8][023]| | ||||||||||
| 71 | 9[0-3] | ||||||||||
| 72 | )| | ||||||||||
| 73 | 7(?: | ||||||||||
| 74 | 0[1-79]| | ||||||||||
| 75 | 10| | ||||||||||
| 76 | 2[014-7]| | ||||||||||
| 77 | 3[0-689]| | ||||||||||
| 78 | 4[019]| | ||||||||||
| 79 | 5[0-3578] | ||||||||||
| 80 | ) | ||||||||||
| 81 | )| | ||||||||||
| 82 | 32(?: | ||||||||||
| 83 | 0[1-69]| | ||||||||||
| 84 | 1[1-35-7]| | ||||||||||
| 85 | 2[024-7]| | ||||||||||
| 86 | 3\\d| | ||||||||||
| 87 | 4[0-3]| | ||||||||||
| 88 | [5-7][023] | ||||||||||
| 89 | )| | ||||||||||
| 90 | 53(?: | ||||||||||
| 91 | 0[0-3]| | ||||||||||
| 92 | [13][023]| | ||||||||||
| 93 | 2[0-59]| | ||||||||||
| 94 | 49| | ||||||||||
| 95 | 5[0-35-9]| | ||||||||||
| 96 | 6[15]| | ||||||||||
| 97 | 7[45]| | ||||||||||
| 98 | 8[1-6]| | ||||||||||
| 99 | 9[0-36-9] | ||||||||||
| 100 | )| | ||||||||||
| 101 | 6(?: | ||||||||||
| 102 | 2(?: | ||||||||||
| 103 | [05]0| | ||||||||||
| 104 | 22 | ||||||||||
| 105 | )| | ||||||||||
| 106 | 3(?: | ||||||||||
| 107 | 00| | ||||||||||
| 108 | 33 | ||||||||||
| 109 | )| | ||||||||||
| 110 | 4(?: | ||||||||||
| 111 | 0[0-25]| | ||||||||||
| 112 | 1[2-7]| | ||||||||||
| 113 | 2[0569]| | ||||||||||
| 114 | [38][07-9]| | ||||||||||
| 115 | 4[025689]| | ||||||||||
| 116 | 6[0-589]| | ||||||||||
| 117 | 7\\d| | ||||||||||
| 118 | 9[0-2] | ||||||||||
| 119 | )| | ||||||||||
| 120 | 5(?: | ||||||||||
| 121 | [01][056]| | ||||||||||
| 122 | 2[034]| | ||||||||||
| 123 | 3[0-57-9]| | ||||||||||
| 124 | 4[178]| | ||||||||||
| 125 | 5[0-69]| | ||||||||||
| 126 | 6[0-35-9]| | ||||||||||
| 127 | 7[1-379]| | ||||||||||
| 128 | 8[0-68]| | ||||||||||
| 129 | 9[0239] | ||||||||||
| 130 | ) | ||||||||||
| 131 | )| | ||||||||||
| 132 | 87(?: | ||||||||||
| 133 | 20| | ||||||||||
| 134 | 7[078]| | ||||||||||
| 135 | 99 | ||||||||||
| 136 | ) | ||||||||||
| 137 | )\\d{4} | ||||||||||
| 138 | ', | ||||||||||
| 139 | 'geographic' => ' | ||||||||||
| 140 | 87(?: | ||||||||||
| 141 | 000| | ||||||||||
| 142 | 90[01] | ||||||||||
| 143 | )\\d{3}| | ||||||||||
| 144 | (?: | ||||||||||
| 145 | 2(?: | ||||||||||
| 146 | 6(?: | ||||||||||
| 147 | 2[0-35-9]| | ||||||||||
| 148 | 3[0-578]| | ||||||||||
| 149 | 4[24-7]| | ||||||||||
| 150 | 5[0-24-8]| | ||||||||||
| 151 | [6-8][023]| | ||||||||||
| 152 | 9[0-3] | ||||||||||
| 153 | )| | ||||||||||
| 154 | 7(?: | ||||||||||
| 155 | 0[1-79]| | ||||||||||
| 156 | 10| | ||||||||||
| 157 | 2[014-7]| | ||||||||||
| 158 | 3[0-689]| | ||||||||||
| 159 | 4[019]| | ||||||||||
| 160 | 5[0-3578] | ||||||||||
| 161 | ) | ||||||||||
| 162 | )| | ||||||||||
| 163 | 32(?: | ||||||||||
| 164 | 0[1-69]| | ||||||||||
| 165 | 1[1-35-7]| | ||||||||||
| 166 | 2[024-7]| | ||||||||||
| 167 | 3\\d| | ||||||||||
| 168 | 4[0-3]| | ||||||||||
| 169 | [5-7][023] | ||||||||||
| 170 | )| | ||||||||||
| 171 | 53(?: | ||||||||||
| 172 | 0[0-3]| | ||||||||||
| 173 | [13][023]| | ||||||||||
| 174 | 2[0-59]| | ||||||||||
| 175 | 49| | ||||||||||
| 176 | 5[0-35-9]| | ||||||||||
| 177 | 6[15]| | ||||||||||
| 178 | 7[45]| | ||||||||||
| 179 | 8[1-6]| | ||||||||||
| 180 | 9[0-36-9] | ||||||||||
| 181 | )| | ||||||||||
| 182 | 6(?: | ||||||||||
| 183 | 2(?: | ||||||||||
| 184 | [05]0| | ||||||||||
| 185 | 22 | ||||||||||
| 186 | )| | ||||||||||
| 187 | 3(?: | ||||||||||
| 188 | 00| | ||||||||||
| 189 | 33 | ||||||||||
| 190 | )| | ||||||||||
| 191 | 4(?: | ||||||||||
| 192 | 0[0-25]| | ||||||||||
| 193 | 1[2-7]| | ||||||||||
| 194 | 2[0569]| | ||||||||||
| 195 | [38][07-9]| | ||||||||||
| 196 | 4[025689]| | ||||||||||
| 197 | 6[0-589]| | ||||||||||
| 198 | 7\\d| | ||||||||||
| 199 | 9[0-2] | ||||||||||
| 200 | )| | ||||||||||
| 201 | 5(?: | ||||||||||
| 202 | [01][056]| | ||||||||||
| 203 | 2[034]| | ||||||||||
| 204 | 3[0-57-9]| | ||||||||||
| 205 | 4[178]| | ||||||||||
| 206 | 5[0-69]| | ||||||||||
| 207 | 6[0-35-9]| | ||||||||||
| 208 | 7[1-379]| | ||||||||||
| 209 | 8[0-68]| | ||||||||||
| 210 | 9[0239] | ||||||||||
| 211 | ) | ||||||||||
| 212 | )| | ||||||||||
| 213 | 87(?: | ||||||||||
| 214 | 20| | ||||||||||
| 215 | 7[078]| | ||||||||||
| 216 | 99 | ||||||||||
| 217 | ) | ||||||||||
| 218 | )\\d{4} | ||||||||||
| 219 | ', | ||||||||||
| 220 | 'mobile' => ' | ||||||||||
| 221 | (?: | ||||||||||
| 222 | 427| | ||||||||||
| 223 | 7(?: | ||||||||||
| 224 | 11| | ||||||||||
| 225 | [29]\\d| | ||||||||||
| 226 | [78][0-25-9] | ||||||||||
| 227 | ) | ||||||||||
| 228 | )\\d{6} | ||||||||||
| 229 | ', | ||||||||||
| 230 | 'pager' => ' | ||||||||||
| 231 | 74(?: | ||||||||||
| 232 | 66| | ||||||||||
| 233 | 77 | ||||||||||
| 234 | )\\d{5} | ||||||||||
| 235 | ', | ||||||||||
| 236 | 'personal_number' => '70\\d{7}', | ||||||||||
| 237 | 'specialrate' => '(85\\d{6})|(9\\d{7})|( | ||||||||||
| 238 | 8(?: | ||||||||||
| 239 | 10| | ||||||||||
| 240 | 8\\d | ||||||||||
| 241 | )\\d{5} | ||||||||||
| 242 | )', | ||||||||||
| 243 | 'toll_free' => '80\\d{6}', | ||||||||||
| 244 | 'voip' => '' | ||||||||||
| 245 | }; | ||||||||||
| 246 | 2 | my %areanames = (); | |||||||||
| 247 | 2 | $areanames{en} = {"962625", "Amman", | |||||||||
| 248 | "96263", "Amman", | ||||||||||
| 249 | "962534", "Balqa", | ||||||||||
| 250 | "962532", "Madaba", | ||||||||||
| 251 | "962321", "Ma\’an", | ||||||||||
| 252 | "962538", "Zarqa", | ||||||||||
| 253 | "96264", "Amman", | ||||||||||
| 254 | "962537", "Zarqa", | ||||||||||
| 255 | "962323", "Karak", | ||||||||||
| 256 | "962530", "Zarqa", | ||||||||||
| 257 | "96227", "Irbid", | ||||||||||
| 258 | "962267", "Jarash", | ||||||||||
| 259 | "962268", "Ajloun", | ||||||||||
| 260 | "962262", "Mafraq", | ||||||||||
| 261 | "962264", "Ajloun", | ||||||||||
| 262 | "962325", "Maan", | ||||||||||
| 263 | "962320", "Aqaba", | ||||||||||
| 264 | "962263", "Jarash", | ||||||||||
| 265 | "9623260", "Tafileh", | ||||||||||
| 266 | "9623262", "Southern\ Region", | ||||||||||
| 267 | "962535", "Balqa", | ||||||||||
| 268 | "962647", "Greater\ Amman", | ||||||||||
| 269 | "962622", "Greater\ Amman", | ||||||||||
| 270 | "962269", "Irbid", | ||||||||||
| 271 | "962536", "Zarqa", | ||||||||||
| 272 | "962539", "Zarqa", | ||||||||||
| 273 | "962266", "Mafraq", | ||||||||||
| 274 | "962265", "Irbid", | ||||||||||
| 275 | "962324", "Aqaba", | ||||||||||
| 276 | "962322", "Tafileh", | ||||||||||
| 277 | "96265", "Amman", | ||||||||||
| 278 | "962531", "Madaba", | ||||||||||
| 279 | "962327", "Karak", | ||||||||||
| 280 | "962620", "Amman", | ||||||||||
| 281 | "962533", "Balqa",}; | ||||||||||
| 282 | 2 | my $timezones = { | |||||||||
| 283 | '' => [ | ||||||||||
| 284 | 'Asia/Amman' | ||||||||||
| 285 | ] | ||||||||||
| 286 | }; | ||||||||||
| 287 | |||||||||||
| 288 | 25 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 289 | 25 | my $class = shift; | |||||||||
| 290 | 25 | my $number = shift; | |||||||||
| 291 | 25 | $number =~ s/(^\+962|\D)//g; | |||||||||
| 292 | 25 | my $self = bless({ country_code => '962', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 293 | 25 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 294 | 1 | $number =~ s/^(?:0)//; | |||||||||
| 295 | 1 | $self = bless({ country_code => '962', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 296 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 297 | } | ||||||||||
| 298 | 2 | 1; | |||||||||