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