| 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::IS; | ||||||||||
| 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' => '[4-9]', | ||||||||||
| 31 | 'pattern' => '(\\d{3})(\\d{4})' | ||||||||||
| 32 | }, | ||||||||||
| 33 | { | ||||||||||
| 34 | 'format' => '$1 $2 $3', | ||||||||||
| 35 | 'leading_digits' => '3', | ||||||||||
| 36 | 'pattern' => '(\\d{3})(\\d{3})(\\d{3})' | ||||||||||
| 37 | } | ||||||||||
| 38 | ]; | ||||||||||
| 39 | |||||||||||
| 40 | 2 | my $validators = { | |||||||||
| 41 | 'fixed_line' => ' | ||||||||||
| 42 | (?: | ||||||||||
| 43 | 4(?: | ||||||||||
| 44 | 1[0-24-69]| | ||||||||||
| 45 | 2[0-7]| | ||||||||||
| 46 | [37][0-8]| | ||||||||||
| 47 | 4[0-24589]| | ||||||||||
| 48 | 5[0-68]| | ||||||||||
| 49 | 6\\d| | ||||||||||
| 50 | 8[0-36-8] | ||||||||||
| 51 | )| | ||||||||||
| 52 | 5(?: | ||||||||||
| 53 | 05| | ||||||||||
| 54 | [156]\\d| | ||||||||||
| 55 | 2[02578]| | ||||||||||
| 56 | 3[0-579]| | ||||||||||
| 57 | 4[03-7]| | ||||||||||
| 58 | 7[0-2578]| | ||||||||||
| 59 | 8[0-35-9]| | ||||||||||
| 60 | 9[013-689] | ||||||||||
| 61 | )| | ||||||||||
| 62 | 872 | ||||||||||
| 63 | )\\d{4} | ||||||||||
| 64 | ', | ||||||||||
| 65 | 'geographic' => ' | ||||||||||
| 66 | (?: | ||||||||||
| 67 | 4(?: | ||||||||||
| 68 | 1[0-24-69]| | ||||||||||
| 69 | 2[0-7]| | ||||||||||
| 70 | [37][0-8]| | ||||||||||
| 71 | 4[0-24589]| | ||||||||||
| 72 | 5[0-68]| | ||||||||||
| 73 | 6\\d| | ||||||||||
| 74 | 8[0-36-8] | ||||||||||
| 75 | )| | ||||||||||
| 76 | 5(?: | ||||||||||
| 77 | 05| | ||||||||||
| 78 | [156]\\d| | ||||||||||
| 79 | 2[02578]| | ||||||||||
| 80 | 3[0-579]| | ||||||||||
| 81 | 4[03-7]| | ||||||||||
| 82 | 7[0-2578]| | ||||||||||
| 83 | 8[0-35-9]| | ||||||||||
| 84 | 9[013-689] | ||||||||||
| 85 | )| | ||||||||||
| 86 | 872 | ||||||||||
| 87 | )\\d{4} | ||||||||||
| 88 | ', | ||||||||||
| 89 | 'mobile' => ' | ||||||||||
| 90 | (?: | ||||||||||
| 91 | 38[589]\\d\\d| | ||||||||||
| 92 | 6(?: | ||||||||||
| 93 | 1[1-8]| | ||||||||||
| 94 | 2[0-6]| | ||||||||||
| 95 | 3[026-9]| | ||||||||||
| 96 | 4[014679]| | ||||||||||
| 97 | 5[0159]| | ||||||||||
| 98 | 6[0-69]| | ||||||||||
| 99 | 70| | ||||||||||
| 100 | 8[06-8]| | ||||||||||
| 101 | 9\\d | ||||||||||
| 102 | )| | ||||||||||
| 103 | 7(?: | ||||||||||
| 104 | 5[057]| | ||||||||||
| 105 | [6-9]\\d | ||||||||||
| 106 | )| | ||||||||||
| 107 | 8(?: | ||||||||||
| 108 | 2[0-59]| | ||||||||||
| 109 | [3-69]\\d| | ||||||||||
| 110 | 8[238] | ||||||||||
| 111 | ) | ||||||||||
| 112 | )\\d{4} | ||||||||||
| 113 | ', | ||||||||||
| 114 | 'pager' => '', | ||||||||||
| 115 | 'personal_number' => '', | ||||||||||
| 116 | 'specialrate' => '( | ||||||||||
| 117 | 90(?: | ||||||||||
| 118 | 0\\d| | ||||||||||
| 119 | 1[5-79]| | ||||||||||
| 120 | 2[015-79]| | ||||||||||
| 121 | 3[135-79]| | ||||||||||
| 122 | 4[125-7]| | ||||||||||
| 123 | 5[25-79]| | ||||||||||
| 124 | 7[1-37]| | ||||||||||
| 125 | 8[0-35-7] | ||||||||||
| 126 | )\\d{3} | ||||||||||
| 127 | )|(809\\d{4})', | ||||||||||
| 128 | 'toll_free' => '80[0-8]\\d{4}', | ||||||||||
| 129 | 'voip' => '49[0-24-79]\\d{4}' | ||||||||||
| 130 | }; | ||||||||||
| 131 | 2 | my %areanames = (); | |||||||||
| 132 | 2 | $areanames{en} = {"35455", "Reykjavík\/Vesturbær\/Miðbærinn", | |||||||||
| 133 | "35446", "Akureyri", | ||||||||||
| 134 | "35442", "Keflavík", | ||||||||||
| 135 | "35456", "Reykjavík\/Vesturbær\/Miðbærinn", | ||||||||||
| 136 | "3545", "Reykjavík",}; | ||||||||||
| 137 | 2 | my $timezones = { | |||||||||
| 138 | '' => [ | ||||||||||
| 139 | 'Atlantic/Reykjavik' | ||||||||||
| 140 | ] | ||||||||||
| 141 | }; | ||||||||||
| 142 | |||||||||||
| 143 | 19 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 144 | 19 | my $class = shift; | |||||||||
| 145 | 19 | my $number = shift; | |||||||||
| 146 | 19 | $number =~ s/(^\+354|\D)//g; | |||||||||
| 147 | 19 | my $self = bless({ country_code => '354', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 148 | 19 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 149 | } | ||||||||||
| 150 | 2 | 1; | |||||||||