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
|
|
1192
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
230
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
970
|
|
|
2
|
|
|
|
|
66
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131447; |
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
|
|
|
|
|
|
|
55410\\d{4}| |
91
|
|
|
|
|
|
|
5(?: |
92
|
|
|
|
|
|
|
(?: |
93
|
|
|
|
|
|
|
[02][02-9]| |
94
|
|
|
|
|
|
|
[149][2-9]| |
95
|
|
|
|
|
|
|
[36]\\d| |
96
|
|
|
|
|
|
|
8[3-7] |
97
|
|
|
|
|
|
|
)\\d| |
98
|
|
|
|
|
|
|
5(?: |
99
|
|
|
|
|
|
|
01| |
100
|
|
|
|
|
|
|
2[2-9]| |
101
|
|
|
|
|
|
|
3[0-3]| |
102
|
|
|
|
|
|
|
4[34]| |
103
|
|
|
|
|
|
|
5[0-25689]| |
104
|
|
|
|
|
|
|
6[6-8]| |
105
|
|
|
|
|
|
|
7[0-267]| |
106
|
|
|
|
|
|
|
8[7-9]| |
107
|
|
|
|
|
|
|
9[1-9] |
108
|
|
|
|
|
|
|
) |
109
|
|
|
|
|
|
|
)\\d{5} |
110
|
|
|
|
|
|
|
', |
111
|
|
|
|
|
|
|
'pager' => '', |
112
|
|
|
|
|
|
|
'personal_number' => '', |
113
|
|
|
|
|
|
|
'specialrate' => '(1700\\d{6})|( |
114
|
|
|
|
|
|
|
1212\\d{4}| |
115
|
|
|
|
|
|
|
1(?: |
116
|
|
|
|
|
|
|
200| |
117
|
|
|
|
|
|
|
9(?: |
118
|
|
|
|
|
|
|
0[0-2]| |
119
|
|
|
|
|
|
|
19 |
120
|
|
|
|
|
|
|
) |
121
|
|
|
|
|
|
|
)\\d{6} |
122
|
|
|
|
|
|
|
)|(1599\\d{6})', |
123
|
|
|
|
|
|
|
'toll_free' => ' |
124
|
|
|
|
|
|
|
1(?: |
125
|
|
|
|
|
|
|
255| |
126
|
|
|
|
|
|
|
80[019]\\d{3} |
127
|
|
|
|
|
|
|
)\\d{3} |
128
|
|
|
|
|
|
|
', |
129
|
|
|
|
|
|
|
'voip' => ' |
130
|
|
|
|
|
|
|
7(?: |
131
|
|
|
|
|
|
|
38(?: |
132
|
|
|
|
|
|
|
0\\d| |
133
|
|
|
|
|
|
|
5[09]| |
134
|
|
|
|
|
|
|
88 |
135
|
|
|
|
|
|
|
)| |
136
|
|
|
|
|
|
|
8(?: |
137
|
|
|
|
|
|
|
33| |
138
|
|
|
|
|
|
|
55| |
139
|
|
|
|
|
|
|
77| |
140
|
|
|
|
|
|
|
81 |
141
|
|
|
|
|
|
|
)\\d |
142
|
|
|
|
|
|
|
)\\d{4}| |
143
|
|
|
|
|
|
|
7(?: |
144
|
|
|
|
|
|
|
18| |
145
|
|
|
|
|
|
|
2[23]| |
146
|
|
|
|
|
|
|
3[237]| |
147
|
|
|
|
|
|
|
47| |
148
|
|
|
|
|
|
|
6[258]| |
149
|
|
|
|
|
|
|
7\\d| |
150
|
|
|
|
|
|
|
82| |
151
|
|
|
|
|
|
|
9[2-9] |
152
|
|
|
|
|
|
|
)\\d{6} |
153
|
|
|
|
|
|
|
' |
154
|
|
|
|
|
|
|
}; |
155
|
|
|
|
|
|
|
my %areanames = (); |
156
|
|
|
|
|
|
|
$areanames{iw} = {"9728", "השפלה\ והדרום", |
157
|
|
|
|
|
|
|
"9724", "חיפה\ והצפון", |
158
|
|
|
|
|
|
|
"9722", "ירושלים", |
159
|
|
|
|
|
|
|
"9729", "השרון", |
160
|
|
|
|
|
|
|
"9723", "תל\ אביב\-יפו\ והמרכז",}; |
161
|
|
|
|
|
|
|
$areanames{en} = {"9723", "Tel\ Aviv", |
162
|
|
|
|
|
|
|
"9729", "Hasharon", |
163
|
|
|
|
|
|
|
"9722", "Jerusalem", |
164
|
|
|
|
|
|
|
"9724", "Haifa\ and\ North\ Regions", |
165
|
|
|
|
|
|
|
"9728", "Hashfela\ and\ South\ Regions",}; |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub new { |
168
|
22
|
|
|
22
|
1
|
45
|
my $class = shift; |
169
|
22
|
|
|
|
|
42
|
my $number = shift; |
170
|
22
|
|
|
|
|
143
|
$number =~ s/(^\+972|\D)//g; |
171
|
22
|
|
|
|
|
137
|
my $self = bless({ country_code => '972', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
172
|
22
|
100
|
|
|
|
104
|
return $self if ($self->is_valid()); |
173
|
1
|
|
|
|
|
13
|
$number =~ s/^(?:0)//; |
174
|
1
|
|
|
|
|
16
|
$self = bless({ country_code => '972', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
175
|
1
|
50
|
|
|
|
11
|
return $self->is_valid() ? $self : undef; |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
1; |