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
|
|
1196
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
260
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
58
|
|
23
|
2
|
|
|
2
|
|
16
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
55
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
13
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
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} = {"38135", "Jagodina", |
102
|
|
|
|
|
|
|
"38127", "Prokuplje", |
103
|
|
|
|
|
|
|
"38116", "Leskovac", |
104
|
|
|
|
|
|
|
"38118", "Nis", |
105
|
|
|
|
|
|
|
"38111", "Belgrade", |
106
|
|
|
|
|
|
|
"38124", "Subotica", |
107
|
|
|
|
|
|
|
"38113", "Pancevo", |
108
|
|
|
|
|
|
|
"38112", "Pozarevac", |
109
|
|
|
|
|
|
|
"38117", "Vranje", |
110
|
|
|
|
|
|
|
"38126", "Smederevo", |
111
|
|
|
|
|
|
|
"38128", "Kosovska\ Mitrovica", |
112
|
|
|
|
|
|
|
"381390", "Dakovica", |
113
|
|
|
|
|
|
|
"381230", "Kikinda", |
114
|
|
|
|
|
|
|
"38123", "Zrenjanin", |
115
|
|
|
|
|
|
|
"38122", "Sremska\ Mitrovica", |
116
|
|
|
|
|
|
|
"38130", "Bor", |
117
|
|
|
|
|
|
|
"38139", "Pec", |
118
|
|
|
|
|
|
|
"381280", "Gnjilane", |
119
|
|
|
|
|
|
|
"38121", "Novi\ Sad", |
120
|
|
|
|
|
|
|
"38114", "Valjevo", |
121
|
|
|
|
|
|
|
"38125", "Sombor", |
122
|
|
|
|
|
|
|
"38137", "Krusevac", |
123
|
|
|
|
|
|
|
"38119", "Zajecar", |
124
|
|
|
|
|
|
|
"38134", "Kragujevac", |
125
|
|
|
|
|
|
|
"38110", "Pirot", |
126
|
|
|
|
|
|
|
"38136", "Kraljevo", |
127
|
|
|
|
|
|
|
"381290", "Urosevac", |
128
|
|
|
|
|
|
|
"38138", "Pristina", |
129
|
|
|
|
|
|
|
"38115", "Sabac", |
130
|
|
|
|
|
|
|
"38133", "Prijepolje", |
131
|
|
|
|
|
|
|
"38132", "Cacak", |
132
|
|
|
|
|
|
|
"38120", "Novi\ Pazar", |
133
|
|
|
|
|
|
|
"38129", "Prizren", |
134
|
|
|
|
|
|
|
"38131", "Uzice",}; |
135
|
|
|
|
|
|
|
$areanames{sr} = {"38134", "Крагујевац", |
136
|
|
|
|
|
|
|
"38119", "Зајечар", |
137
|
|
|
|
|
|
|
"38110", "Пирот", |
138
|
|
|
|
|
|
|
"38125", "Сомбор", |
139
|
|
|
|
|
|
|
"38137", "Крушевац", |
140
|
|
|
|
|
|
|
"38133", "Пријепоље", |
141
|
|
|
|
|
|
|
"38120", "Нови\ Пазар", |
142
|
|
|
|
|
|
|
"38132", "Чачак", |
143
|
|
|
|
|
|
|
"38129", "Призрен", |
144
|
|
|
|
|
|
|
"38131", "Ужице", |
145
|
|
|
|
|
|
|
"38138", "Приштина", |
146
|
|
|
|
|
|
|
"381290", "Урошевац", |
147
|
|
|
|
|
|
|
"38136", "Краљево", |
148
|
|
|
|
|
|
|
"38115", "Шабац", |
149
|
|
|
|
|
|
|
"38124", "Суботица", |
150
|
|
|
|
|
|
|
"38111", "Београд", |
151
|
|
|
|
|
|
|
"38113", "Панчево", |
152
|
|
|
|
|
|
|
"38112", "Пожаревац", |
153
|
|
|
|
|
|
|
"38135", "Јагодина", |
154
|
|
|
|
|
|
|
"38118", "Ниш", |
155
|
|
|
|
|
|
|
"38127", "Прокупље", |
156
|
|
|
|
|
|
|
"38116", "Лесковац", |
157
|
|
|
|
|
|
|
"38123", "Зрењанин", |
158
|
|
|
|
|
|
|
"38130", "Бор", |
159
|
|
|
|
|
|
|
"38122", "Сремска\ Митровица", |
160
|
|
|
|
|
|
|
"38114", "Ваљево", |
161
|
|
|
|
|
|
|
"381280", "Гњилане", |
162
|
|
|
|
|
|
|
"38139", "Пећ", |
163
|
|
|
|
|
|
|
"38121", "Нови\ Сад", |
164
|
|
|
|
|
|
|
"381390", "Ђаковица", |
165
|
|
|
|
|
|
|
"38128", "Косовска\ Митровица", |
166
|
|
|
|
|
|
|
"38117", "Врање", |
167
|
|
|
|
|
|
|
"38126", "Смедерево", |
168
|
|
|
|
|
|
|
"381230", "Кикинда",}; |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
sub new { |
171
|
16
|
|
|
16
|
1
|
32
|
my $class = shift; |
172
|
16
|
|
|
|
|
34
|
my $number = shift; |
173
|
16
|
|
|
|
|
127
|
$number =~ s/(^\+381|\D)//g; |
174
|
16
|
|
|
|
|
93
|
my $self = bless({ country_code => '381', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
175
|
16
|
100
|
|
|
|
77
|
return $self if ($self->is_valid()); |
176
|
1
|
|
|
|
|
11
|
$number =~ s/^(?:0)//; |
177
|
1
|
|
|
|
|
12
|
$self = bless({ country_code => '381', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
178
|
1
|
50
|
|
|
|
6
|
return $self->is_valid() ? $self : undef; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
1; |