| 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::LY; | ||||||||||
| 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', | ||||||||||
| 30 | 'leading_digits' => '[2-9]', | ||||||||||
| 31 | 'national_rule' => '0$1', | ||||||||||
| 32 | 'pattern' => '(\\d{2})(\\d{7})' | ||||||||||
| 33 | } | ||||||||||
| 34 | ]; | ||||||||||
| 35 | |||||||||||
| 36 | 2 | my $validators = { | |||||||||
| 37 | 'fixed_line' => ' | ||||||||||
| 38 | (?: | ||||||||||
| 39 | 2(?: | ||||||||||
| 40 | 0[56]| | ||||||||||
| 41 | [1-6]\\d| | ||||||||||
| 42 | 7[124579]| | ||||||||||
| 43 | 8[124] | ||||||||||
| 44 | )| | ||||||||||
| 45 | 3(?: | ||||||||||
| 46 | 1\\d| | ||||||||||
| 47 | 2[2356] | ||||||||||
| 48 | )| | ||||||||||
| 49 | 4(?: | ||||||||||
| 50 | [17]\\d| | ||||||||||
| 51 | 2[1-357]| | ||||||||||
| 52 | 5[2-4]| | ||||||||||
| 53 | 8[124] | ||||||||||
| 54 | )| | ||||||||||
| 55 | 5(?: | ||||||||||
| 56 | [1347]\\d| | ||||||||||
| 57 | 2[1-469]| | ||||||||||
| 58 | 5[13-5]| | ||||||||||
| 59 | 8[1-4] | ||||||||||
| 60 | )| | ||||||||||
| 61 | 6(?: | ||||||||||
| 62 | [1-479]\\d| | ||||||||||
| 63 | 5[2-57]| | ||||||||||
| 64 | 8[1-5] | ||||||||||
| 65 | )| | ||||||||||
| 66 | 7(?: | ||||||||||
| 67 | [13]\\d| | ||||||||||
| 68 | 2[13-79] | ||||||||||
| 69 | )| | ||||||||||
| 70 | 8(?: | ||||||||||
| 71 | [124]\\d| | ||||||||||
| 72 | 5[124]| | ||||||||||
| 73 | 84 | ||||||||||
| 74 | ) | ||||||||||
| 75 | )\\d{6} | ||||||||||
| 76 | ', | ||||||||||
| 77 | 'geographic' => ' | ||||||||||
| 78 | (?: | ||||||||||
| 79 | 2(?: | ||||||||||
| 80 | 0[56]| | ||||||||||
| 81 | [1-6]\\d| | ||||||||||
| 82 | 7[124579]| | ||||||||||
| 83 | 8[124] | ||||||||||
| 84 | )| | ||||||||||
| 85 | 3(?: | ||||||||||
| 86 | 1\\d| | ||||||||||
| 87 | 2[2356] | ||||||||||
| 88 | )| | ||||||||||
| 89 | 4(?: | ||||||||||
| 90 | [17]\\d| | ||||||||||
| 91 | 2[1-357]| | ||||||||||
| 92 | 5[2-4]| | ||||||||||
| 93 | 8[124] | ||||||||||
| 94 | )| | ||||||||||
| 95 | 5(?: | ||||||||||
| 96 | [1347]\\d| | ||||||||||
| 97 | 2[1-469]| | ||||||||||
| 98 | 5[13-5]| | ||||||||||
| 99 | 8[1-4] | ||||||||||
| 100 | )| | ||||||||||
| 101 | 6(?: | ||||||||||
| 102 | [1-479]\\d| | ||||||||||
| 103 | 5[2-57]| | ||||||||||
| 104 | 8[1-5] | ||||||||||
| 105 | )| | ||||||||||
| 106 | 7(?: | ||||||||||
| 107 | [13]\\d| | ||||||||||
| 108 | 2[13-79] | ||||||||||
| 109 | )| | ||||||||||
| 110 | 8(?: | ||||||||||
| 111 | [124]\\d| | ||||||||||
| 112 | 5[124]| | ||||||||||
| 113 | 84 | ||||||||||
| 114 | ) | ||||||||||
| 115 | )\\d{6} | ||||||||||
| 116 | ', | ||||||||||
| 117 | 'mobile' => '9[1-6]\\d{7}', | ||||||||||
| 118 | 'pager' => '', | ||||||||||
| 119 | 'personal_number' => '', | ||||||||||
| 120 | 'specialrate' => '', | ||||||||||
| 121 | 'toll_free' => '', | ||||||||||
| 122 | 'voip' => '' | ||||||||||
| 123 | }; | ||||||||||
| 124 | 2 | my %areanames = (); | |||||||||
| 125 | 2 | $areanames{en} = {"218481", "Kabaw", | |||||||||
| 126 | "218524", "Kasarahmad", | ||||||||||
| 127 | "21863", "Benina", | ||||||||||
| 128 | "218623", "Gmines", | ||||||||||
| 129 | "21821", "Tripoli", | ||||||||||
| 130 | "218584", "Zella", | ||||||||||
| 131 | "218653", "Ojla", | ||||||||||
| 132 | "21841", "Garian", | ||||||||||
| 133 | "218854", "Slenta", | ||||||||||
| 134 | "218421", "Yefren", | ||||||||||
| 135 | "218727", "Zawaya", | ||||||||||
| 136 | "21847", "Nalut", | ||||||||||
| 137 | "218732", "Bergen", | ||||||||||
| 138 | "218322", "Bani\ Walid", | ||||||||||
| 139 | "218683", "Taknes", | ||||||||||
| 140 | "218554", "Wadi\ Jeref", | ||||||||||
| 141 | "218425", "Buzayan", | ||||||||||
| 142 | "218281", "Jmail", | ||||||||||
| 143 | "21873", "Ubary", | ||||||||||
| 144 | "218284", "Hugialin", | ||||||||||
| 145 | "218551", "Sirt", | ||||||||||
| 146 | "218323", "Wadi\ Keam", | ||||||||||
| 147 | "218205", "Sidiessaiah", | ||||||||||
| 148 | "218206", "Suk\ Elkhamis", | ||||||||||
| 149 | "218682", "Jardas", | ||||||||||
| 150 | "218723", "Edry", | ||||||||||
| 151 | "218657", "Jalo", | ||||||||||
| 152 | "218733", "Garda", | ||||||||||
| 153 | "218652", "Kofra", | ||||||||||
| 154 | "218555", "Noflia", | ||||||||||
| 155 | "218581", "Wodan", | ||||||||||
| 156 | "218851", "Shahat", | ||||||||||
| 157 | "218224", "Swajni", | ||||||||||
| 158 | "218628", "Seluk", | ||||||||||
| 159 | "218627", "Jerdina", | ||||||||||
| 160 | "21881", "Derna", | ||||||||||
| 161 | "218454", "Al\ Josh", | ||||||||||
| 162 | "218821", "Gubba", | ||||||||||
| 163 | "218526", "Zawyat\ Elmahjub", | ||||||||||
| 164 | "21857", "Hun", | ||||||||||
| 165 | "218529", "Bugrain", | ||||||||||
| 166 | "218277", "Mamura", | ||||||||||
| 167 | "218521", "Zliten", | ||||||||||
| 168 | "218272", "Azizia", | ||||||||||
| 169 | "21851", "Misratah", | ||||||||||
| 170 | "218484", "Ghadames", | ||||||||||
| 171 | "218726", "Um\ Laranib", | ||||||||||
| 172 | "218725", "Murzuk", | ||||||||||
| 173 | "218282", "Agelat\,\ Ajalat", | ||||||||||
| 174 | "21831", "Khums", | ||||||||||
| 175 | "218684", "Elbayada", | ||||||||||
| 176 | "218553", "Abuhadi", | ||||||||||
| 177 | "21871", "Sebha", | ||||||||||
| 178 | "218731", "Wadi\ Atba", | ||||||||||
| 179 | "218252", "Zahra", | ||||||||||
| 180 | "218721", "Brak", | ||||||||||
| 181 | "218427", "Kikla", | ||||||||||
| 182 | "218422", "Mizda", | ||||||||||
| 183 | "218583", "Soussa", | ||||||||||
| 184 | "218654", "Sidi\ Sultan\ Sultan", | ||||||||||
| 185 | "218326", "Kussabat", | ||||||||||
| 186 | "21888", "Jaghbub", | ||||||||||
| 187 | "218729", "Ghrefa", | ||||||||||
| 188 | "218325", "Tarhuna", | ||||||||||
| 189 | "21854", "Sirt", | ||||||||||
| 190 | "218624", "Elkuwaifia", | ||||||||||
| 191 | "218452", "Rujban", | ||||||||||
| 192 | "21826", "Taigura", | ||||||||||
| 193 | "21884", "El\ Beida", | ||||||||||
| 194 | "21882", "Haraua", | ||||||||||
| 195 | "218274", "Abu\ Issa", | ||||||||||
| 196 | "218482", "Tigi", | ||||||||||
| 197 | "218523", "Dafnia", | ||||||||||
| 198 | "218271", "Hashan", | ||||||||||
| 199 | "218626", "Kaalifa", | ||||||||||
| 200 | "218625", "Deriana", | ||||||||||
| 201 | "21824", "Sabratha", | ||||||||||
| 202 | "218522", "Tawergha", | ||||||||||
| 203 | "218279", "Elmaya", | ||||||||||
| 204 | "21822", "Ben\ Gashir", | ||||||||||
| 205 | "21823", "Zawia", | ||||||||||
| 206 | "21861", "Benghazi", | ||||||||||
| 207 | "218275", "Matred", | ||||||||||
| 208 | "218453", "Reyana", | ||||||||||
| 209 | "21867", "Elmareg", | ||||||||||
| 210 | "218629", "Elmagrun", | ||||||||||
| 211 | "218423", "Guassem", | ||||||||||
| 212 | "218582", "Sokna", | ||||||||||
| 213 | "218852", "Massa", | ||||||||||
| 214 | "218685", "Tomina", | ||||||||||
| 215 | "218724", "Ghat", | ||||||||||
| 216 | "218734", "Traghen", | ||||||||||
| 217 | "218681", "Tolmitha", | ||||||||||
| 218 | "218655", "Bisher", | ||||||||||
| 219 | "21825", "Zuara",}; | ||||||||||
| 220 | 2 | my $timezones = { | |||||||||
| 221 | '' => [ | ||||||||||
| 222 | 'Europe/Bucharest' | ||||||||||
| 223 | ] | ||||||||||
| 224 | }; | ||||||||||
| 225 | |||||||||||
| 226 | 7 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 227 | 7 | my $class = shift; | |||||||||
| 228 | 7 | my $number = shift; | |||||||||
| 229 | 7 | $number =~ s/(^\+218|\D)//g; | |||||||||
| 230 | 7 | my $self = bless({ country_code => '218', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 231 | 7 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 232 | 1 | $number =~ s/^(?:0)//; | |||||||||
| 233 | 1 | $self = bless({ country_code => '218', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 234 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 235 | } | ||||||||||
| 236 | 2 | 1; | |||||||||