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
|
|
1323
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
252
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
48
|
|
23
|
2
|
|
|
2
|
|
23
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
11
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131447; |
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
|
|
|
|
|
|
|
[12]\\d| |
151
|
|
|
|
|
|
|
88 |
152
|
|
|
|
|
|
|
)| |
153
|
|
|
|
|
|
|
9(?: |
154
|
|
|
|
|
|
|
0[0-3]| |
155
|
|
|
|
|
|
|
[19]\\d| |
156
|
|
|
|
|
|
|
21| |
157
|
|
|
|
|
|
|
69| |
158
|
|
|
|
|
|
|
77| |
159
|
|
|
|
|
|
|
8[7-9] |
160
|
|
|
|
|
|
|
) |
161
|
|
|
|
|
|
|
) |
162
|
|
|
|
|
|
|
)\\d{5} |
163
|
|
|
|
|
|
|
', |
164
|
|
|
|
|
|
|
'pager' => '', |
165
|
|
|
|
|
|
|
'personal_number' => '', |
166
|
|
|
|
|
|
|
'specialrate' => '( |
167
|
|
|
|
|
|
|
96(?: |
168
|
|
|
|
|
|
|
0[12]| |
169
|
|
|
|
|
|
|
2[16-8]| |
170
|
|
|
|
|
|
|
3(?: |
171
|
|
|
|
|
|
|
08| |
172
|
|
|
|
|
|
|
[14]5| |
173
|
|
|
|
|
|
|
[23]| |
174
|
|
|
|
|
|
|
66 |
175
|
|
|
|
|
|
|
)| |
176
|
|
|
|
|
|
|
4(?: |
177
|
|
|
|
|
|
|
0| |
178
|
|
|
|
|
|
|
80 |
179
|
|
|
|
|
|
|
)| |
180
|
|
|
|
|
|
|
5[01]| |
181
|
|
|
|
|
|
|
6[89]| |
182
|
|
|
|
|
|
|
86| |
183
|
|
|
|
|
|
|
9[19] |
184
|
|
|
|
|
|
|
) |
185
|
|
|
|
|
|
|
)', |
186
|
|
|
|
|
|
|
'toll_free' => '', |
187
|
|
|
|
|
|
|
'voip' => '' |
188
|
|
|
|
|
|
|
}; |
189
|
|
|
|
|
|
|
my %areanames = (); |
190
|
|
|
|
|
|
|
$areanames{en} = {"9858", "North\ Khorasan", |
191
|
|
|
|
|
|
|
"9817", "Golestan", |
192
|
|
|
|
|
|
|
"9876", "Hormozgan", |
193
|
|
|
|
|
|
|
"9834", "Kerman\ province", |
194
|
|
|
|
|
|
|
"9821", "Tehran\ province", |
195
|
|
|
|
|
|
|
"9845", "Ardabil\ province", |
196
|
|
|
|
|
|
|
"9828", "Qazvin\ province", |
197
|
|
|
|
|
|
|
"9851", "Razavi\ Khorasan", |
198
|
|
|
|
|
|
|
"9844", "West\ Azarbaijan", |
199
|
|
|
|
|
|
|
"9886", "Markazi", |
200
|
|
|
|
|
|
|
"9835", "Yazd\ province", |
201
|
|
|
|
|
|
|
"9854", "Sistan\ and\ Baluchestan", |
202
|
|
|
|
|
|
|
"9866", "Lorestan", |
203
|
|
|
|
|
|
|
"9838", "Chahar\-mahal\ and\ Bakhtiari", |
204
|
|
|
|
|
|
|
"9831", "Isfahan\ province", |
205
|
|
|
|
|
|
|
"9824", "Zanjan\ province", |
206
|
|
|
|
|
|
|
"9811", "Mazandaran", |
207
|
|
|
|
|
|
|
"9825", "Qom\ province", |
208
|
|
|
|
|
|
|
"9883", "Kermanshah\ province", |
209
|
|
|
|
|
|
|
"9841", "East\ Azarbaijan", |
210
|
|
|
|
|
|
|
"9871", "Fars", |
211
|
|
|
|
|
|
|
"9826", "Alborz", |
212
|
|
|
|
|
|
|
"9813", "Gilan", |
213
|
|
|
|
|
|
|
"9856", "South\ Khorasan", |
214
|
|
|
|
|
|
|
"9881", "Hamadan\ province", |
215
|
|
|
|
|
|
|
"9861", "Khuzestan", |
216
|
|
|
|
|
|
|
"9877", "Bushehr\ province", |
217
|
|
|
|
|
|
|
"9874", "Kohgiluyeh\ and\ Boyer\-Ahmad", |
218
|
|
|
|
|
|
|
"9823", "Semnan\ province", |
219
|
|
|
|
|
|
|
"9884", "Ilam\ province", |
220
|
|
|
|
|
|
|
"9887", "Kurdistan",}; |
221
|
|
|
|
|
|
|
$areanames{fa} = {"9831", "استان\ اصفهان", |
222
|
|
|
|
|
|
|
"9824", "استان\ زنجان", |
223
|
|
|
|
|
|
|
"9811", "مازندران", |
224
|
|
|
|
|
|
|
"9866", "لرستان", |
225
|
|
|
|
|
|
|
"9854", "سیستان\ و\ بلوچستان", |
226
|
|
|
|
|
|
|
"9838", "چهارمحال\ و\ بختیاری", |
227
|
|
|
|
|
|
|
"9883", "استان\ کرمانشاه", |
228
|
|
|
|
|
|
|
"9841", "آذربایجان\ شرقی", |
229
|
|
|
|
|
|
|
"9825", "استان\ قم", |
230
|
|
|
|
|
|
|
"9845", "استان\ اردبیل", |
231
|
|
|
|
|
|
|
"9828", "استان\ قزوین", |
232
|
|
|
|
|
|
|
"9851", "خراسان\ رضوی", |
233
|
|
|
|
|
|
|
"9858", "خراسان\ شمالی", |
234
|
|
|
|
|
|
|
"9817", "گلستان", |
235
|
|
|
|
|
|
|
"9821", "استان\ تهران", |
236
|
|
|
|
|
|
|
"9834", "استان\ کرمان", |
237
|
|
|
|
|
|
|
"9876", "هرمزگان", |
238
|
|
|
|
|
|
|
"9835", "استان\ یزد", |
239
|
|
|
|
|
|
|
"9844", "آذربایجان\ غربی", |
240
|
|
|
|
|
|
|
"9886", "مرکزی", |
241
|
|
|
|
|
|
|
"9823", "استان\ سمنان", |
242
|
|
|
|
|
|
|
"9874", "کهگیلویه\ و\ بویراحمد", |
243
|
|
|
|
|
|
|
"9877", "استان\ بوشهر", |
244
|
|
|
|
|
|
|
"9861", "خوزستان", |
245
|
|
|
|
|
|
|
"9887", "کردستان", |
246
|
|
|
|
|
|
|
"9884", "استان\ ایلام", |
247
|
|
|
|
|
|
|
"9856", "خراسان\ جنوبی", |
248
|
|
|
|
|
|
|
"9826", "البرز", |
249
|
|
|
|
|
|
|
"9871", "فارس", |
250
|
|
|
|
|
|
|
"9813", "گیلان", |
251
|
|
|
|
|
|
|
"9881", "استان\ همدان",}; |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub new { |
254
|
10
|
|
|
10
|
1
|
29
|
my $class = shift; |
255
|
10
|
|
|
|
|
21
|
my $number = shift; |
256
|
10
|
|
|
|
|
66
|
$number =~ s/(^\+98|\D)//g; |
257
|
10
|
|
|
|
|
109
|
my $self = bless({ country_code => '98', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
258
|
10
|
100
|
|
|
|
88
|
return $self if ($self->is_valid()); |
259
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
260
|
1
|
|
|
|
|
13
|
$self = bless({ country_code => '98', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
261
|
1
|
50
|
|
|
|
8
|
return $self->is_valid() ? $self : undef; |
262
|
|
|
|
|
|
|
} |
263
|
|
|
|
|
|
|
1; |