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
|
|
1328
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
243
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
49
|
|
23
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181420; |
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
|
|
|
|
|
|
|
380| |
131
|
|
|
|
|
|
|
8(?: |
132
|
|
|
|
|
|
|
33| |
133
|
|
|
|
|
|
|
55| |
134
|
|
|
|
|
|
|
77| |
135
|
|
|
|
|
|
|
81 |
136
|
|
|
|
|
|
|
) |
137
|
|
|
|
|
|
|
)\\d{5}| |
138
|
|
|
|
|
|
|
7(?: |
139
|
|
|
|
|
|
|
18| |
140
|
|
|
|
|
|
|
2[23]| |
141
|
|
|
|
|
|
|
3[237]| |
142
|
|
|
|
|
|
|
47| |
143
|
|
|
|
|
|
|
6[258]| |
144
|
|
|
|
|
|
|
7\\d| |
145
|
|
|
|
|
|
|
82| |
146
|
|
|
|
|
|
|
9[2-9] |
147
|
|
|
|
|
|
|
)\\d{6} |
148
|
|
|
|
|
|
|
' |
149
|
|
|
|
|
|
|
}; |
150
|
|
|
|
|
|
|
my %areanames = (); |
151
|
|
|
|
|
|
|
$areanames{iw} = {"9723", "תל\ אביב\-יפו\ והמרכז", |
152
|
|
|
|
|
|
|
"9729", "השרון", |
153
|
|
|
|
|
|
|
"9724", "חיפה\ והצפון", |
154
|
|
|
|
|
|
|
"9722", "ירושלים", |
155
|
|
|
|
|
|
|
"9728", "השפלה\ והדרום",}; |
156
|
|
|
|
|
|
|
$areanames{en} = {"9723", "Tel\ Aviv", |
157
|
|
|
|
|
|
|
"9729", "Hasharon", |
158
|
|
|
|
|
|
|
"9724", "Haifa\ and\ North\ Regions", |
159
|
|
|
|
|
|
|
"9722", "Jerusalem", |
160
|
|
|
|
|
|
|
"9728", "Hashfela\ and\ South\ Regions",}; |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub new { |
163
|
22
|
|
|
22
|
1
|
49
|
my $class = shift; |
164
|
22
|
|
|
|
|
40
|
my $number = shift; |
165
|
22
|
|
|
|
|
139
|
$number =~ s/(^\+972|\D)//g; |
166
|
22
|
|
|
|
|
141
|
my $self = bless({ country_code => '972', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
167
|
22
|
100
|
|
|
|
93
|
return $self if ($self->is_valid()); |
168
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
169
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '972', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
170
|
1
|
50
|
|
|
|
12
|
return $self->is_valid() ? $self : undef; |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
1; |