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
|
|
1345
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
278
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
55
|
|
23
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
56
|
|
24
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181420; |
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{en} = {"9828", "Qazvin\ province", |
190
|
|
|
|
|
|
|
"9824", "Zanjan\ province", |
191
|
|
|
|
|
|
|
"9856", "South\ Khorasan", |
192
|
|
|
|
|
|
|
"9844", "West\ Azarbaijan", |
193
|
|
|
|
|
|
|
"9876", "Hormozgan", |
194
|
|
|
|
|
|
|
"9886", "Markazi", |
195
|
|
|
|
|
|
|
"9845", "Ardabil\ province", |
196
|
|
|
|
|
|
|
"9851", "Razavi\ Khorasan", |
197
|
|
|
|
|
|
|
"9881", "Hamadan\ province", |
198
|
|
|
|
|
|
|
"9825", "Qom\ province", |
199
|
|
|
|
|
|
|
"9871", "Fars", |
200
|
|
|
|
|
|
|
"9826", "Alborz", |
201
|
|
|
|
|
|
|
"9854", "Sistan\ and\ Baluchestan", |
202
|
|
|
|
|
|
|
"9874", "Kohgiluyeh\ and\ Boyer\-Ahmad", |
203
|
|
|
|
|
|
|
"9884", "Ilam\ province", |
204
|
|
|
|
|
|
|
"9858", "North\ Khorasan", |
205
|
|
|
|
|
|
|
"9811", "Mazandaran", |
206
|
|
|
|
|
|
|
"9821", "Tehran\ province", |
207
|
|
|
|
|
|
|
"9841", "East\ Azarbaijan", |
208
|
|
|
|
|
|
|
"9823", "Semnan\ province", |
209
|
|
|
|
|
|
|
"9813", "Gilan", |
210
|
|
|
|
|
|
|
"9861", "Khuzestan", |
211
|
|
|
|
|
|
|
"9817", "Golestan", |
212
|
|
|
|
|
|
|
"9831", "Isfahan\ province", |
213
|
|
|
|
|
|
|
"9866", "Lorestan", |
214
|
|
|
|
|
|
|
"9883", "Kermanshah\ province", |
215
|
|
|
|
|
|
|
"9834", "Kerman\ province", |
216
|
|
|
|
|
|
|
"9838", "Chahar\-mahal\ and\ Bakhtiari", |
217
|
|
|
|
|
|
|
"9835", "Yazd\ province", |
218
|
|
|
|
|
|
|
"9887", "Kurdistan", |
219
|
|
|
|
|
|
|
"9877", "Bushehr\ province",}; |
220
|
|
|
|
|
|
|
$areanames{fa} = {"9823", "استان\ سمنان", |
221
|
|
|
|
|
|
|
"9861", "خوزستان", |
222
|
|
|
|
|
|
|
"9813", "گیلان", |
223
|
|
|
|
|
|
|
"9831", "استان\ اصفهان", |
224
|
|
|
|
|
|
|
"9817", "گلستان", |
225
|
|
|
|
|
|
|
"9866", "لرستان", |
226
|
|
|
|
|
|
|
"9883", "استان\ کرمانشاه", |
227
|
|
|
|
|
|
|
"9834", "استان\ کرمان", |
228
|
|
|
|
|
|
|
"9838", "چهارمحال\ و\ بختیاری", |
229
|
|
|
|
|
|
|
"9835", "استان\ یزد", |
230
|
|
|
|
|
|
|
"9877", "استان\ بوشهر", |
231
|
|
|
|
|
|
|
"9887", "کردستان", |
232
|
|
|
|
|
|
|
"9828", "استان\ قزوین", |
233
|
|
|
|
|
|
|
"9824", "استان\ زنجان", |
234
|
|
|
|
|
|
|
"9844", "آذربایجان\ غربی", |
235
|
|
|
|
|
|
|
"9856", "خراسان\ جنوبی", |
236
|
|
|
|
|
|
|
"9886", "مرکزی", |
237
|
|
|
|
|
|
|
"9876", "هرمزگان", |
238
|
|
|
|
|
|
|
"9845", "استان\ اردبیل", |
239
|
|
|
|
|
|
|
"9851", "خراسان\ رضوی", |
240
|
|
|
|
|
|
|
"9871", "فارس", |
241
|
|
|
|
|
|
|
"9825", "استان\ قم", |
242
|
|
|
|
|
|
|
"9881", "استان\ همدان", |
243
|
|
|
|
|
|
|
"9826", "البرز", |
244
|
|
|
|
|
|
|
"9854", "سیستان\ و\ بلوچستان", |
245
|
|
|
|
|
|
|
"9858", "خراسان\ شمالی", |
246
|
|
|
|
|
|
|
"9884", "استان\ ایلام", |
247
|
|
|
|
|
|
|
"9874", "کهگیلویه\ و\ بویراحمد", |
248
|
|
|
|
|
|
|
"9811", "مازندران", |
249
|
|
|
|
|
|
|
"9821", "استان\ تهران", |
250
|
|
|
|
|
|
|
"9841", "آذربایجان\ شرقی",}; |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
sub new { |
253
|
10
|
|
|
10
|
1
|
21
|
my $class = shift; |
254
|
10
|
|
|
|
|
19
|
my $number = shift; |
255
|
10
|
|
|
|
|
63
|
$number =~ s/(^\+98|\D)//g; |
256
|
10
|
|
|
|
|
62
|
my $self = bless({ country_code => '98', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
257
|
10
|
100
|
|
|
|
45
|
return $self if ($self->is_valid()); |
258
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
259
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '98', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
260
|
1
|
50
|
|
|
|
3
|
return $self->is_valid() ? $self : undef; |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
1; |