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::IR; |
20
|
2
|
|
|
2
|
|
1290
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
239
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
59
|
|
23
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
62
|
|
24
|
2
|
|
|
2
|
|
23
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
16
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174403; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1', |
30
|
|
|
|
|
|
|
'leading_digits' => '96', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{4,5})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
(?: |
38
|
|
|
|
|
|
|
1[137]| |
39
|
|
|
|
|
|
|
2[13-68]| |
40
|
|
|
|
|
|
|
3[1458]| |
41
|
|
|
|
|
|
|
4[145]| |
42
|
|
|
|
|
|
|
5[1468]| |
43
|
|
|
|
|
|
|
6[16]| |
44
|
|
|
|
|
|
|
7[1467]| |
45
|
|
|
|
|
|
|
8[13467] |
46
|
|
|
|
|
|
|
)[12689] |
47
|
|
|
|
|
|
|
', |
48
|
|
|
|
|
|
|
'national_rule' => '0$1', |
49
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{4,5})' |
50
|
|
|
|
|
|
|
}, |
51
|
|
|
|
|
|
|
{ |
52
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
53
|
|
|
|
|
|
|
'leading_digits' => '9', |
54
|
|
|
|
|
|
|
'national_rule' => '0$1', |
55
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})' |
56
|
|
|
|
|
|
|
}, |
57
|
|
|
|
|
|
|
{ |
58
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
59
|
|
|
|
|
|
|
'leading_digits' => '[1-8]', |
60
|
|
|
|
|
|
|
'national_rule' => '0$1', |
61
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{4})(\\d{4})' |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
]; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $validators = { |
66
|
|
|
|
|
|
|
'fixed_line' => ' |
67
|
|
|
|
|
|
|
(?: |
68
|
|
|
|
|
|
|
1[137]| |
69
|
|
|
|
|
|
|
2[13-68]| |
70
|
|
|
|
|
|
|
3[1458]| |
71
|
|
|
|
|
|
|
4[145]| |
72
|
|
|
|
|
|
|
5[1468]| |
73
|
|
|
|
|
|
|
6[16]| |
74
|
|
|
|
|
|
|
7[1467]| |
75
|
|
|
|
|
|
|
8[13467] |
76
|
|
|
|
|
|
|
)(?: |
77
|
|
|
|
|
|
|
[03-57]\\d{7}| |
78
|
|
|
|
|
|
|
[16]\\d{3}(?: |
79
|
|
|
|
|
|
|
\\d{4} |
80
|
|
|
|
|
|
|
)?| |
81
|
|
|
|
|
|
|
[289]\\d{3}(?: |
82
|
|
|
|
|
|
|
\\d(?: |
83
|
|
|
|
|
|
|
\\d{3} |
84
|
|
|
|
|
|
|
)? |
85
|
|
|
|
|
|
|
)? |
86
|
|
|
|
|
|
|
)| |
87
|
|
|
|
|
|
|
94(?: |
88
|
|
|
|
|
|
|
000[09]| |
89
|
|
|
|
|
|
|
2(?: |
90
|
|
|
|
|
|
|
121| |
91
|
|
|
|
|
|
|
[2689]0\\d |
92
|
|
|
|
|
|
|
)| |
93
|
|
|
|
|
|
|
30[0-2]\\d| |
94
|
|
|
|
|
|
|
4(?: |
95
|
|
|
|
|
|
|
111| |
96
|
|
|
|
|
|
|
40\\d |
97
|
|
|
|
|
|
|
) |
98
|
|
|
|
|
|
|
)\\d{4} |
99
|
|
|
|
|
|
|
', |
100
|
|
|
|
|
|
|
'geographic' => ' |
101
|
|
|
|
|
|
|
(?: |
102
|
|
|
|
|
|
|
1[137]| |
103
|
|
|
|
|
|
|
2[13-68]| |
104
|
|
|
|
|
|
|
3[1458]| |
105
|
|
|
|
|
|
|
4[145]| |
106
|
|
|
|
|
|
|
5[1468]| |
107
|
|
|
|
|
|
|
6[16]| |
108
|
|
|
|
|
|
|
7[1467]| |
109
|
|
|
|
|
|
|
8[13467] |
110
|
|
|
|
|
|
|
)(?: |
111
|
|
|
|
|
|
|
[03-57]\\d{7}| |
112
|
|
|
|
|
|
|
[16]\\d{3}(?: |
113
|
|
|
|
|
|
|
\\d{4} |
114
|
|
|
|
|
|
|
)?| |
115
|
|
|
|
|
|
|
[289]\\d{3}(?: |
116
|
|
|
|
|
|
|
\\d(?: |
117
|
|
|
|
|
|
|
\\d{3} |
118
|
|
|
|
|
|
|
)? |
119
|
|
|
|
|
|
|
)? |
120
|
|
|
|
|
|
|
)| |
121
|
|
|
|
|
|
|
94(?: |
122
|
|
|
|
|
|
|
000[09]| |
123
|
|
|
|
|
|
|
2(?: |
124
|
|
|
|
|
|
|
121| |
125
|
|
|
|
|
|
|
[2689]0\\d |
126
|
|
|
|
|
|
|
)| |
127
|
|
|
|
|
|
|
30[0-2]\\d| |
128
|
|
|
|
|
|
|
4(?: |
129
|
|
|
|
|
|
|
111| |
130
|
|
|
|
|
|
|
40\\d |
131
|
|
|
|
|
|
|
) |
132
|
|
|
|
|
|
|
)\\d{4} |
133
|
|
|
|
|
|
|
', |
134
|
|
|
|
|
|
|
'mobile' => ' |
135
|
|
|
|
|
|
|
9(?: |
136
|
|
|
|
|
|
|
(?: |
137
|
|
|
|
|
|
|
0(?: |
138
|
|
|
|
|
|
|
[0-35]\\d| |
139
|
|
|
|
|
|
|
4[4-6] |
140
|
|
|
|
|
|
|
)| |
141
|
|
|
|
|
|
|
(?: |
142
|
|
|
|
|
|
|
[13]\\d| |
143
|
|
|
|
|
|
|
2[0-3] |
144
|
|
|
|
|
|
|
)\\d |
145
|
|
|
|
|
|
|
)\\d| |
146
|
|
|
|
|
|
|
9(?: |
147
|
|
|
|
|
|
|
[0-46]\\d\\d| |
148
|
|
|
|
|
|
|
5[15]0| |
149
|
|
|
|
|
|
|
8(?: |
150
|
|
|
|
|
|
|
1\\d| |
151
|
|
|
|
|
|
|
88 |
152
|
|
|
|
|
|
|
)| |
153
|
|
|
|
|
|
|
9(?: |
154
|
|
|
|
|
|
|
0[0-3]| |
155
|
|
|
|
|
|
|
[19]\\d| |
156
|
|
|
|
|
|
|
21| |
157
|
|
|
|
|
|
|
77| |
158
|
|
|
|
|
|
|
8[7-9] |
159
|
|
|
|
|
|
|
) |
160
|
|
|
|
|
|
|
) |
161
|
|
|
|
|
|
|
)\\d{5} |
162
|
|
|
|
|
|
|
', |
163
|
|
|
|
|
|
|
'pager' => '', |
164
|
|
|
|
|
|
|
'personal_number' => '', |
165
|
|
|
|
|
|
|
'specialrate' => '( |
166
|
|
|
|
|
|
|
96(?: |
167
|
|
|
|
|
|
|
0[12]| |
168
|
|
|
|
|
|
|
2[16-8]| |
169
|
|
|
|
|
|
|
3(?: |
170
|
|
|
|
|
|
|
08| |
171
|
|
|
|
|
|
|
[14]5| |
172
|
|
|
|
|
|
|
[23]| |
173
|
|
|
|
|
|
|
66 |
174
|
|
|
|
|
|
|
)| |
175
|
|
|
|
|
|
|
4(?: |
176
|
|
|
|
|
|
|
0| |
177
|
|
|
|
|
|
|
80 |
178
|
|
|
|
|
|
|
)| |
179
|
|
|
|
|
|
|
5[01]| |
180
|
|
|
|
|
|
|
6[89]| |
181
|
|
|
|
|
|
|
86| |
182
|
|
|
|
|
|
|
9[19] |
183
|
|
|
|
|
|
|
) |
184
|
|
|
|
|
|
|
)', |
185
|
|
|
|
|
|
|
'toll_free' => '', |
186
|
|
|
|
|
|
|
'voip' => '' |
187
|
|
|
|
|
|
|
}; |
188
|
|
|
|
|
|
|
my %areanames = (); |
189
|
|
|
|
|
|
|
$areanames{fa} = {"9884", "استان\ ایلام", |
190
|
|
|
|
|
|
|
"9817", "گلستان", |
191
|
|
|
|
|
|
|
"9856", "خراسان\ جنوبی", |
192
|
|
|
|
|
|
|
"9834", "استان\ کرمان", |
193
|
|
|
|
|
|
|
"9845", "استان\ اردبیل", |
194
|
|
|
|
|
|
|
"9876", "هرمزگان", |
195
|
|
|
|
|
|
|
"9811", "مازندران", |
196
|
|
|
|
|
|
|
"9866", "لرستان", |
197
|
|
|
|
|
|
|
"9821", "استان\ تهران", |
198
|
|
|
|
|
|
|
"9858", "خراسان\ شمالی", |
199
|
|
|
|
|
|
|
"9838", "چهارمحال\ و\ بختیاری", |
200
|
|
|
|
|
|
|
"9841", "آذربایجان\ شرقی", |
201
|
|
|
|
|
|
|
"9886", "مرکزی", |
202
|
|
|
|
|
|
|
"9825", "استان\ قم", |
203
|
|
|
|
|
|
|
"9854", "سیستان\ و\ بلوچستان", |
204
|
|
|
|
|
|
|
"9874", "کهگیلویه\ و\ بویراحمد", |
205
|
|
|
|
|
|
|
"9883", "استان\ کرمانشاه", |
206
|
|
|
|
|
|
|
"9831", "استان\ اصفهان", |
207
|
|
|
|
|
|
|
"9887", "کردستان", |
208
|
|
|
|
|
|
|
"9824", "استان\ زنجان", |
209
|
|
|
|
|
|
|
"9881", "استان\ همدان", |
210
|
|
|
|
|
|
|
"9871", "فارس", |
211
|
|
|
|
|
|
|
"9826", "البرز", |
212
|
|
|
|
|
|
|
"9861", "خوزستان", |
213
|
|
|
|
|
|
|
"9844", "آذربایجان\ غربی", |
214
|
|
|
|
|
|
|
"9835", "استان\ یزد", |
215
|
|
|
|
|
|
|
"9877", "استان\ بوشهر", |
216
|
|
|
|
|
|
|
"9823", "استان\ سمنان", |
217
|
|
|
|
|
|
|
"9851", "خراسان\ رضوی", |
218
|
|
|
|
|
|
|
"9828", "استان\ قزوین", |
219
|
|
|
|
|
|
|
"9813", "گیلان",}; |
220
|
|
|
|
|
|
|
$areanames{en} = {"9876", "Hormozgan", |
221
|
|
|
|
|
|
|
"9845", "Ardabil\ province", |
222
|
|
|
|
|
|
|
"9834", "Kerman\ province", |
223
|
|
|
|
|
|
|
"9821", "Tehran\ province", |
224
|
|
|
|
|
|
|
"9858", "North\ Khorasan", |
225
|
|
|
|
|
|
|
"9866", "Lorestan", |
226
|
|
|
|
|
|
|
"9811", "Mazandaran", |
227
|
|
|
|
|
|
|
"9817", "Golestan", |
228
|
|
|
|
|
|
|
"9856", "South\ Khorasan", |
229
|
|
|
|
|
|
|
"9884", "Ilam\ province", |
230
|
|
|
|
|
|
|
"9874", "Kohgiluyeh\ and\ Boyer\-Ahmad", |
231
|
|
|
|
|
|
|
"9883", "Kermanshah\ province", |
232
|
|
|
|
|
|
|
"9841", "East\ Azarbaijan", |
233
|
|
|
|
|
|
|
"9838", "Chahar\-mahal\ and\ Bakhtiari", |
234
|
|
|
|
|
|
|
"9854", "Sistan\ and\ Baluchestan", |
235
|
|
|
|
|
|
|
"9825", "Qom\ province", |
236
|
|
|
|
|
|
|
"9886", "Markazi", |
237
|
|
|
|
|
|
|
"9881", "Hamadan\ province", |
238
|
|
|
|
|
|
|
"9831", "Isfahan\ province", |
239
|
|
|
|
|
|
|
"9887", "Kurdistan", |
240
|
|
|
|
|
|
|
"9824", "Zanjan\ province", |
241
|
|
|
|
|
|
|
"9835", "Yazd\ province", |
242
|
|
|
|
|
|
|
"9877", "Bushehr\ province", |
243
|
|
|
|
|
|
|
"9844", "West\ Azarbaijan", |
244
|
|
|
|
|
|
|
"9813", "Gilan", |
245
|
|
|
|
|
|
|
"9828", "Qazvin\ province", |
246
|
|
|
|
|
|
|
"9851", "Razavi\ Khorasan", |
247
|
|
|
|
|
|
|
"9823", "Semnan\ province", |
248
|
|
|
|
|
|
|
"9871", "Fars", |
249
|
|
|
|
|
|
|
"9861", "Khuzestan", |
250
|
|
|
|
|
|
|
"9826", "Alborz",}; |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
sub new { |
253
|
10
|
|
|
10
|
1
|
32
|
my $class = shift; |
254
|
10
|
|
|
|
|
24
|
my $number = shift; |
255
|
10
|
|
|
|
|
66
|
$number =~ s/(^\+98|\D)//g; |
256
|
10
|
|
|
|
|
73
|
my $self = bless({ country_code => '98', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
257
|
10
|
100
|
|
|
|
58
|
return $self if ($self->is_valid()); |
258
|
1
|
|
|
|
|
2
|
$number =~ s/^(?:0)//; |
259
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '98', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
260
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
1; |