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::RS; |
20
|
2
|
|
|
2
|
|
1131
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
276
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
35
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
49
|
|
23
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
47
|
|
24
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
15
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
(?: |
32
|
|
|
|
|
|
|
2[389]| |
33
|
|
|
|
|
|
|
39 |
34
|
|
|
|
|
|
|
)0| |
35
|
|
|
|
|
|
|
[7-9] |
36
|
|
|
|
|
|
|
', |
37
|
|
|
|
|
|
|
'national_rule' => '0$1', |
38
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3,9})' |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
'format' => '$1 $2', |
42
|
|
|
|
|
|
|
'leading_digits' => '[1-36]', |
43
|
|
|
|
|
|
|
'national_rule' => '0$1', |
44
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{5,10})' |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
]; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $validators = { |
49
|
|
|
|
|
|
|
'fixed_line' => ' |
50
|
|
|
|
|
|
|
(?: |
51
|
|
|
|
|
|
|
11[1-9]\\d| |
52
|
|
|
|
|
|
|
(?: |
53
|
|
|
|
|
|
|
2[389]| |
54
|
|
|
|
|
|
|
39 |
55
|
|
|
|
|
|
|
)(?: |
56
|
|
|
|
|
|
|
0[2-9]| |
57
|
|
|
|
|
|
|
[2-9]\\d |
58
|
|
|
|
|
|
|
) |
59
|
|
|
|
|
|
|
)\\d{3,8}| |
60
|
|
|
|
|
|
|
(?: |
61
|
|
|
|
|
|
|
1[02-9]| |
62
|
|
|
|
|
|
|
2[0-24-7]| |
63
|
|
|
|
|
|
|
3[0-8] |
64
|
|
|
|
|
|
|
)[2-9]\\d{4,9} |
65
|
|
|
|
|
|
|
', |
66
|
|
|
|
|
|
|
'geographic' => ' |
67
|
|
|
|
|
|
|
(?: |
68
|
|
|
|
|
|
|
11[1-9]\\d| |
69
|
|
|
|
|
|
|
(?: |
70
|
|
|
|
|
|
|
2[389]| |
71
|
|
|
|
|
|
|
39 |
72
|
|
|
|
|
|
|
)(?: |
73
|
|
|
|
|
|
|
0[2-9]| |
74
|
|
|
|
|
|
|
[2-9]\\d |
75
|
|
|
|
|
|
|
) |
76
|
|
|
|
|
|
|
)\\d{3,8}| |
77
|
|
|
|
|
|
|
(?: |
78
|
|
|
|
|
|
|
1[02-9]| |
79
|
|
|
|
|
|
|
2[0-24-7]| |
80
|
|
|
|
|
|
|
3[0-8] |
81
|
|
|
|
|
|
|
)[2-9]\\d{4,9} |
82
|
|
|
|
|
|
|
', |
83
|
|
|
|
|
|
|
'mobile' => ' |
84
|
|
|
|
|
|
|
6(?: |
85
|
|
|
|
|
|
|
[0-689]| |
86
|
|
|
|
|
|
|
7\\d |
87
|
|
|
|
|
|
|
)\\d{6,7} |
88
|
|
|
|
|
|
|
', |
89
|
|
|
|
|
|
|
'pager' => '', |
90
|
|
|
|
|
|
|
'personal_number' => '', |
91
|
|
|
|
|
|
|
'specialrate' => '( |
92
|
|
|
|
|
|
|
(?: |
93
|
|
|
|
|
|
|
78\\d| |
94
|
|
|
|
|
|
|
90[0169] |
95
|
|
|
|
|
|
|
)\\d{3,7} |
96
|
|
|
|
|
|
|
)|(7[06]\\d{4,10})', |
97
|
|
|
|
|
|
|
'toll_free' => '800\\d{3,9}', |
98
|
|
|
|
|
|
|
'voip' => '' |
99
|
|
|
|
|
|
|
}; |
100
|
|
|
|
|
|
|
my %areanames = (); |
101
|
|
|
|
|
|
|
$areanames{en} = {"38119", "Zajecar", |
102
|
|
|
|
|
|
|
"38130", "Bor", |
103
|
|
|
|
|
|
|
"38128", "Kosovska\ Mitrovica", |
104
|
|
|
|
|
|
|
"38114", "Valjevo", |
105
|
|
|
|
|
|
|
"38137", "Krusevac", |
106
|
|
|
|
|
|
|
"38125", "Sombor", |
107
|
|
|
|
|
|
|
"38121", "Novi\ Sad", |
108
|
|
|
|
|
|
|
"38122", "Sremska\ Mitrovica", |
109
|
|
|
|
|
|
|
"38120", "Novi\ Pazar", |
110
|
|
|
|
|
|
|
"38138", "Pristina", |
111
|
|
|
|
|
|
|
"38116", "Leskovac", |
112
|
|
|
|
|
|
|
"38113", "Pancevo", |
113
|
|
|
|
|
|
|
"381280", "Gnjilane", |
114
|
|
|
|
|
|
|
"38135", "Jagodina", |
115
|
|
|
|
|
|
|
"38131", "Uzice", |
116
|
|
|
|
|
|
|
"38132", "Cacak", |
117
|
|
|
|
|
|
|
"38127", "Prokuplje", |
118
|
|
|
|
|
|
|
"38111", "Belgrade", |
119
|
|
|
|
|
|
|
"38112", "Pozarevac", |
120
|
|
|
|
|
|
|
"38115", "Sabac", |
121
|
|
|
|
|
|
|
"38129", "Prizren", |
122
|
|
|
|
|
|
|
"38133", "Prijepolje", |
123
|
|
|
|
|
|
|
"38136", "Kraljevo", |
124
|
|
|
|
|
|
|
"38118", "Nis", |
125
|
|
|
|
|
|
|
"381390", "Dakovica", |
126
|
|
|
|
|
|
|
"38124", "Subotica", |
127
|
|
|
|
|
|
|
"381230", "Kikinda", |
128
|
|
|
|
|
|
|
"38117", "Vranje", |
129
|
|
|
|
|
|
|
"38126", "Smederevo", |
130
|
|
|
|
|
|
|
"38134", "Kragujevac", |
131
|
|
|
|
|
|
|
"381290", "Urosevac", |
132
|
|
|
|
|
|
|
"38110", "Pirot", |
133
|
|
|
|
|
|
|
"38139", "Pec", |
134
|
|
|
|
|
|
|
"38123", "Zrenjanin",}; |
135
|
|
|
|
|
|
|
$areanames{sr} = {"38110", "Пирот", |
136
|
|
|
|
|
|
|
"381290", "Урошевац", |
137
|
|
|
|
|
|
|
"38134", "Крагујевац", |
138
|
|
|
|
|
|
|
"38126", "Смедерево", |
139
|
|
|
|
|
|
|
"38123", "Зрењанин", |
140
|
|
|
|
|
|
|
"38139", "Пећ", |
141
|
|
|
|
|
|
|
"38117", "Врање", |
142
|
|
|
|
|
|
|
"38133", "Пријепоље", |
143
|
|
|
|
|
|
|
"38129", "Призрен", |
144
|
|
|
|
|
|
|
"381230", "Кикинда", |
145
|
|
|
|
|
|
|
"38124", "Суботица", |
146
|
|
|
|
|
|
|
"381390", "Ђаковица", |
147
|
|
|
|
|
|
|
"38118", "Ниш", |
148
|
|
|
|
|
|
|
"38136", "Краљево", |
149
|
|
|
|
|
|
|
"38115", "Шабац", |
150
|
|
|
|
|
|
|
"38112", "Пожаревац", |
151
|
|
|
|
|
|
|
"38111", "Београд", |
152
|
|
|
|
|
|
|
"38132", "Чачак", |
153
|
|
|
|
|
|
|
"38131", "Ужице", |
154
|
|
|
|
|
|
|
"38135", "Јагодина", |
155
|
|
|
|
|
|
|
"38127", "Прокупље", |
156
|
|
|
|
|
|
|
"38116", "Лесковац", |
157
|
|
|
|
|
|
|
"38138", "Приштина", |
158
|
|
|
|
|
|
|
"38120", "Нови\ Пазар", |
159
|
|
|
|
|
|
|
"381280", "Гњилане", |
160
|
|
|
|
|
|
|
"38113", "Панчево", |
161
|
|
|
|
|
|
|
"38137", "Крушевац", |
162
|
|
|
|
|
|
|
"38122", "Сремска\ Митровица", |
163
|
|
|
|
|
|
|
"38121", "Нови\ Сад", |
164
|
|
|
|
|
|
|
"38125", "Сомбор", |
165
|
|
|
|
|
|
|
"38119", "Зајечар", |
166
|
|
|
|
|
|
|
"38114", "Ваљево", |
167
|
|
|
|
|
|
|
"38128", "Косовска\ Митровица", |
168
|
|
|
|
|
|
|
"38130", "Бор",}; |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
sub new { |
171
|
16
|
|
|
16
|
1
|
38
|
my $class = shift; |
172
|
16
|
|
|
|
|
34
|
my $number = shift; |
173
|
16
|
|
|
|
|
111
|
$number =~ s/(^\+381|\D)//g; |
174
|
16
|
|
|
|
|
95
|
my $self = bless({ country_code => '381', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
175
|
16
|
100
|
|
|
|
75
|
return $self if ($self->is_valid()); |
176
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
177
|
1
|
|
|
|
|
10
|
$self = bless({ country_code => '381', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
178
|
1
|
50
|
|
|
|
3
|
return $self->is_valid() ? $self : undef; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
1; |