line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 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::IL; |
20
|
2
|
|
|
2
|
|
1365
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
286
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
26
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
67
|
|
23
|
2
|
|
|
2
|
|
16
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
81
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
23
|
|
|
2
|
|
|
|
|
23
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174403; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
30
|
|
|
|
|
|
|
'leading_digits' => '125', |
31
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})' |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
35
|
|
|
|
|
|
|
'leading_digits' => '121', |
36
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{2})(\\d{2})' |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
{ |
39
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
40
|
|
|
|
|
|
|
'leading_digits' => '[2-489]', |
41
|
|
|
|
|
|
|
'national_rule' => '0$1', |
42
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{4})' |
43
|
|
|
|
|
|
|
}, |
44
|
|
|
|
|
|
|
{ |
45
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
46
|
|
|
|
|
|
|
'leading_digits' => '[57]', |
47
|
|
|
|
|
|
|
'national_rule' => '0$1', |
48
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
49
|
|
|
|
|
|
|
}, |
50
|
|
|
|
|
|
|
{ |
51
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
52
|
|
|
|
|
|
|
'leading_digits' => '12', |
53
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})(\\d{3})' |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
{ |
56
|
|
|
|
|
|
|
'format' => '$1-$2', |
57
|
|
|
|
|
|
|
'leading_digits' => '159', |
58
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{6})' |
59
|
|
|
|
|
|
|
}, |
60
|
|
|
|
|
|
|
{ |
61
|
|
|
|
|
|
|
'format' => '$1-$2-$3-$4', |
62
|
|
|
|
|
|
|
'leading_digits' => '1[7-9]', |
63
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})' |
64
|
|
|
|
|
|
|
}, |
65
|
|
|
|
|
|
|
{ |
66
|
|
|
|
|
|
|
'format' => '$1-$2 $3-$4', |
67
|
|
|
|
|
|
|
'leading_digits' => '15', |
68
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})' |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
]; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $validators = { |
73
|
|
|
|
|
|
|
'fixed_line' => ' |
74
|
|
|
|
|
|
|
153\\d{8,9}| |
75
|
|
|
|
|
|
|
29[1-9]\\d{5}| |
76
|
|
|
|
|
|
|
(?: |
77
|
|
|
|
|
|
|
2[0-8]| |
78
|
|
|
|
|
|
|
[3489]\\d |
79
|
|
|
|
|
|
|
)\\d{6} |
80
|
|
|
|
|
|
|
', |
81
|
|
|
|
|
|
|
'geographic' => ' |
82
|
|
|
|
|
|
|
153\\d{8,9}| |
83
|
|
|
|
|
|
|
29[1-9]\\d{5}| |
84
|
|
|
|
|
|
|
(?: |
85
|
|
|
|
|
|
|
2[0-8]| |
86
|
|
|
|
|
|
|
[3489]\\d |
87
|
|
|
|
|
|
|
)\\d{6} |
88
|
|
|
|
|
|
|
', |
89
|
|
|
|
|
|
|
'mobile' => ' |
90
|
|
|
|
|
|
|
5(?: |
91
|
|
|
|
|
|
|
(?: |
92
|
|
|
|
|
|
|
[02368]\\d| |
93
|
|
|
|
|
|
|
[19][2-9]| |
94
|
|
|
|
|
|
|
4[1-9] |
95
|
|
|
|
|
|
|
)\\d| |
96
|
|
|
|
|
|
|
5(?: |
97
|
|
|
|
|
|
|
01| |
98
|
|
|
|
|
|
|
1[79]| |
99
|
|
|
|
|
|
|
2[2-9]| |
100
|
|
|
|
|
|
|
3[0-3]| |
101
|
|
|
|
|
|
|
4[34]| |
102
|
|
|
|
|
|
|
5[015689]| |
103
|
|
|
|
|
|
|
6[6-8]| |
104
|
|
|
|
|
|
|
7[0-267]| |
105
|
|
|
|
|
|
|
8[7-9]| |
106
|
|
|
|
|
|
|
9[1-9] |
107
|
|
|
|
|
|
|
) |
108
|
|
|
|
|
|
|
)\\d{5} |
109
|
|
|
|
|
|
|
', |
110
|
|
|
|
|
|
|
'pager' => '', |
111
|
|
|
|
|
|
|
'personal_number' => '', |
112
|
|
|
|
|
|
|
'specialrate' => '(1700\\d{6})|( |
113
|
|
|
|
|
|
|
1212\\d{4}| |
114
|
|
|
|
|
|
|
1(?: |
115
|
|
|
|
|
|
|
200| |
116
|
|
|
|
|
|
|
9(?: |
117
|
|
|
|
|
|
|
0[0-2]| |
118
|
|
|
|
|
|
|
19 |
119
|
|
|
|
|
|
|
) |
120
|
|
|
|
|
|
|
)\\d{6} |
121
|
|
|
|
|
|
|
)|(1599\\d{6})', |
122
|
|
|
|
|
|
|
'toll_free' => ' |
123
|
|
|
|
|
|
|
1(?: |
124
|
|
|
|
|
|
|
255| |
125
|
|
|
|
|
|
|
80[019]\\d{3} |
126
|
|
|
|
|
|
|
)\\d{3} |
127
|
|
|
|
|
|
|
', |
128
|
|
|
|
|
|
|
'voip' => ' |
129
|
|
|
|
|
|
|
7(?: |
130
|
|
|
|
|
|
|
38(?: |
131
|
|
|
|
|
|
|
0\\d| |
132
|
|
|
|
|
|
|
5[09]| |
133
|
|
|
|
|
|
|
88 |
134
|
|
|
|
|
|
|
)| |
135
|
|
|
|
|
|
|
8(?: |
136
|
|
|
|
|
|
|
33| |
137
|
|
|
|
|
|
|
55| |
138
|
|
|
|
|
|
|
77| |
139
|
|
|
|
|
|
|
81 |
140
|
|
|
|
|
|
|
)\\d |
141
|
|
|
|
|
|
|
)\\d{4}| |
142
|
|
|
|
|
|
|
7(?: |
143
|
|
|
|
|
|
|
18| |
144
|
|
|
|
|
|
|
2[23]| |
145
|
|
|
|
|
|
|
3[237]| |
146
|
|
|
|
|
|
|
47| |
147
|
|
|
|
|
|
|
6[258]| |
148
|
|
|
|
|
|
|
7\\d| |
149
|
|
|
|
|
|
|
82| |
150
|
|
|
|
|
|
|
9[2-9] |
151
|
|
|
|
|
|
|
)\\d{6} |
152
|
|
|
|
|
|
|
' |
153
|
|
|
|
|
|
|
}; |
154
|
|
|
|
|
|
|
my %areanames = (); |
155
|
|
|
|
|
|
|
$areanames{iw} = {"9729", "השרון", |
156
|
|
|
|
|
|
|
"9722", "ירושלים", |
157
|
|
|
|
|
|
|
"9724", "חיפה\ והצפון", |
158
|
|
|
|
|
|
|
"9728", "השפלה\ והדרום", |
159
|
|
|
|
|
|
|
"9723", "תל\ אביב\-יפו\ והמרכז",}; |
160
|
|
|
|
|
|
|
$areanames{en} = {"9729", "Hasharon", |
161
|
|
|
|
|
|
|
"9722", "Jerusalem", |
162
|
|
|
|
|
|
|
"9728", "Hashfela\ and\ South\ Regions", |
163
|
|
|
|
|
|
|
"9724", "Haifa\ and\ North\ Regions", |
164
|
|
|
|
|
|
|
"9723", "Tel\ Aviv",}; |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub new { |
167
|
22
|
|
|
22
|
1
|
52
|
my $class = shift; |
168
|
22
|
|
|
|
|
36
|
my $number = shift; |
169
|
22
|
|
|
|
|
146
|
$number =~ s/(^\+972|\D)//g; |
170
|
22
|
|
|
|
|
157
|
my $self = bless({ country_code => '972', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
171
|
22
|
100
|
|
|
|
121
|
return $self if ($self->is_valid()); |
172
|
1
|
|
|
|
|
4
|
$number =~ s/^(?:0)//; |
173
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '972', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
174
|
1
|
50
|
|
|
|
8
|
return $self->is_valid() ? $self : undef; |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
1; |