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::KR; |
20
|
2
|
|
|
2
|
|
1115
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
219
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
43
|
|
23
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131447; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => '1[016-9]114', |
32
|
|
|
|
|
|
|
'national_rule' => '0$1', |
33
|
|
|
|
|
|
|
'pattern' => '(\\d{5})' |
34
|
|
|
|
|
|
|
}, |
35
|
|
|
|
|
|
|
{ |
36
|
|
|
|
|
|
|
'format' => '$1-$2', |
37
|
|
|
|
|
|
|
'leading_digits' => ' |
38
|
|
|
|
|
|
|
(?: |
39
|
|
|
|
|
|
|
3[1-3]| |
40
|
|
|
|
|
|
|
[46][1-4]| |
41
|
|
|
|
|
|
|
5[1-5] |
42
|
|
|
|
|
|
|
)1 |
43
|
|
|
|
|
|
|
', |
44
|
|
|
|
|
|
|
'national_rule' => '0$1', |
45
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3,4})' |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
'format' => '$1-$2', |
49
|
|
|
|
|
|
|
'leading_digits' => '1', |
50
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{4})' |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
54
|
|
|
|
|
|
|
'leading_digits' => '2', |
55
|
|
|
|
|
|
|
'national_rule' => '0$1', |
56
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3,4})(\\d{4})' |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
60
|
|
|
|
|
|
|
'leading_digits' => ' |
61
|
|
|
|
|
|
|
60| |
62
|
|
|
|
|
|
|
8 |
63
|
|
|
|
|
|
|
', |
64
|
|
|
|
|
|
|
'national_rule' => '0$1', |
65
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
66
|
|
|
|
|
|
|
}, |
67
|
|
|
|
|
|
|
{ |
68
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
69
|
|
|
|
|
|
|
'leading_digits' => ' |
70
|
|
|
|
|
|
|
[1346]| |
71
|
|
|
|
|
|
|
5[1-5] |
72
|
|
|
|
|
|
|
', |
73
|
|
|
|
|
|
|
'national_rule' => '0$1', |
74
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})' |
75
|
|
|
|
|
|
|
}, |
76
|
|
|
|
|
|
|
{ |
77
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
78
|
|
|
|
|
|
|
'leading_digits' => '[57]', |
79
|
|
|
|
|
|
|
'national_rule' => '0$1', |
80
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{4})(\\d{4})' |
81
|
|
|
|
|
|
|
}, |
82
|
|
|
|
|
|
|
{ |
83
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
84
|
|
|
|
|
|
|
'intl_format' => 'NA', |
85
|
|
|
|
|
|
|
'leading_digits' => '0030', |
86
|
|
|
|
|
|
|
'pattern' => '(\\d{5})(\\d{3})(\\d{3})' |
87
|
|
|
|
|
|
|
}, |
88
|
|
|
|
|
|
|
{ |
89
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
90
|
|
|
|
|
|
|
'leading_digits' => '5', |
91
|
|
|
|
|
|
|
'national_rule' => '0$1', |
92
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{5})(\\d{4})' |
93
|
|
|
|
|
|
|
}, |
94
|
|
|
|
|
|
|
{ |
95
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
96
|
|
|
|
|
|
|
'intl_format' => 'NA', |
97
|
|
|
|
|
|
|
'pattern' => '(\\d{5})(\\d{3,4})(\\d{4})' |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
{ |
100
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
101
|
|
|
|
|
|
|
'intl_format' => 'NA', |
102
|
|
|
|
|
|
|
'pattern' => '(\\d{5})(\\d{2})(\\d{3})(\\d{4})' |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
]; |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
my $validators = { |
107
|
|
|
|
|
|
|
'fixed_line' => ' |
108
|
|
|
|
|
|
|
(?: |
109
|
|
|
|
|
|
|
2| |
110
|
|
|
|
|
|
|
3[1-3]| |
111
|
|
|
|
|
|
|
[46][1-4]| |
112
|
|
|
|
|
|
|
5[1-5] |
113
|
|
|
|
|
|
|
)[1-9]\\d{6,7}| |
114
|
|
|
|
|
|
|
(?: |
115
|
|
|
|
|
|
|
3[1-3]| |
116
|
|
|
|
|
|
|
[46][1-4]| |
117
|
|
|
|
|
|
|
5[1-5] |
118
|
|
|
|
|
|
|
)1\\d{2,3} |
119
|
|
|
|
|
|
|
', |
120
|
|
|
|
|
|
|
'geographic' => ' |
121
|
|
|
|
|
|
|
(?: |
122
|
|
|
|
|
|
|
2| |
123
|
|
|
|
|
|
|
3[1-3]| |
124
|
|
|
|
|
|
|
[46][1-4]| |
125
|
|
|
|
|
|
|
5[1-5] |
126
|
|
|
|
|
|
|
)[1-9]\\d{6,7}| |
127
|
|
|
|
|
|
|
(?: |
128
|
|
|
|
|
|
|
3[1-3]| |
129
|
|
|
|
|
|
|
[46][1-4]| |
130
|
|
|
|
|
|
|
5[1-5] |
131
|
|
|
|
|
|
|
)1\\d{2,3} |
132
|
|
|
|
|
|
|
', |
133
|
|
|
|
|
|
|
'mobile' => ' |
134
|
|
|
|
|
|
|
1(?: |
135
|
|
|
|
|
|
|
05(?: |
136
|
|
|
|
|
|
|
[0-8]\\d| |
137
|
|
|
|
|
|
|
9[0-6] |
138
|
|
|
|
|
|
|
)| |
139
|
|
|
|
|
|
|
22[13]\\d |
140
|
|
|
|
|
|
|
)\\d{4,5}| |
141
|
|
|
|
|
|
|
1(?: |
142
|
|
|
|
|
|
|
0[0-46-9]| |
143
|
|
|
|
|
|
|
[16-9]\\d| |
144
|
|
|
|
|
|
|
2[013-9] |
145
|
|
|
|
|
|
|
)\\d{6,7} |
146
|
|
|
|
|
|
|
', |
147
|
|
|
|
|
|
|
'pager' => '15\\d{7,8}', |
148
|
|
|
|
|
|
|
'personal_number' => '50\\d{8,9}', |
149
|
|
|
|
|
|
|
'specialrate' => '(60[2-9]\\d{6})|( |
150
|
|
|
|
|
|
|
1(?: |
151
|
|
|
|
|
|
|
5(?: |
152
|
|
|
|
|
|
|
22| |
153
|
|
|
|
|
|
|
33| |
154
|
|
|
|
|
|
|
44| |
155
|
|
|
|
|
|
|
66| |
156
|
|
|
|
|
|
|
77| |
157
|
|
|
|
|
|
|
88| |
158
|
|
|
|
|
|
|
99 |
159
|
|
|
|
|
|
|
)| |
160
|
|
|
|
|
|
|
6(?: |
161
|
|
|
|
|
|
|
[07]0| |
162
|
|
|
|
|
|
|
44| |
163
|
|
|
|
|
|
|
6[168]| |
164
|
|
|
|
|
|
|
88 |
165
|
|
|
|
|
|
|
)| |
166
|
|
|
|
|
|
|
8(?: |
167
|
|
|
|
|
|
|
00| |
168
|
|
|
|
|
|
|
33| |
169
|
|
|
|
|
|
|
55| |
170
|
|
|
|
|
|
|
77| |
171
|
|
|
|
|
|
|
99 |
172
|
|
|
|
|
|
|
) |
173
|
|
|
|
|
|
|
)\\d{4} |
174
|
|
|
|
|
|
|
)', |
175
|
|
|
|
|
|
|
'toll_free' => ' |
176
|
|
|
|
|
|
|
00(?: |
177
|
|
|
|
|
|
|
308\\d{6,7}| |
178
|
|
|
|
|
|
|
798\\d{7,9} |
179
|
|
|
|
|
|
|
)| |
180
|
|
|
|
|
|
|
(?: |
181
|
|
|
|
|
|
|
00368| |
182
|
|
|
|
|
|
|
80 |
183
|
|
|
|
|
|
|
)\\d{7} |
184
|
|
|
|
|
|
|
', |
185
|
|
|
|
|
|
|
'voip' => '70\\d{8}' |
186
|
|
|
|
|
|
|
}; |
187
|
|
|
|
|
|
|
my %areanames = (); |
188
|
|
|
|
|
|
|
$areanames{en} = {"8244", "Sejong\ City", |
189
|
|
|
|
|
|
|
"822", "Seoul", |
190
|
|
|
|
|
|
|
"8242", "Daejeon", |
191
|
|
|
|
|
|
|
"8243", "Chungbuk", |
192
|
|
|
|
|
|
|
"8264", "Jeju", |
193
|
|
|
|
|
|
|
"8251", "Busan", |
194
|
|
|
|
|
|
|
"8263", "Jeonbuk", |
195
|
|
|
|
|
|
|
"8262", "Gwangju", |
196
|
|
|
|
|
|
|
"8233", "Gangwon", |
197
|
|
|
|
|
|
|
"8232", "Incheon", |
198
|
|
|
|
|
|
|
"8255", "Gyeongnam", |
199
|
|
|
|
|
|
|
"8241", "Chungnam", |
200
|
|
|
|
|
|
|
"8231", "Gyeonggi", |
201
|
|
|
|
|
|
|
"8254", "Gyeongbuk", |
202
|
|
|
|
|
|
|
"8253", "Daegu", |
203
|
|
|
|
|
|
|
"8252", "Ulsan", |
204
|
|
|
|
|
|
|
"8261", "Jeonnam",}; |
205
|
|
|
|
|
|
|
$areanames{ko} = {"8231", "경기", |
206
|
|
|
|
|
|
|
"8261", "전남", |
207
|
|
|
|
|
|
|
"8252", "울산", |
208
|
|
|
|
|
|
|
"8253", "대구", |
209
|
|
|
|
|
|
|
"8254", "경북", |
210
|
|
|
|
|
|
|
"8241", "충남", |
211
|
|
|
|
|
|
|
"8255", "경남", |
212
|
|
|
|
|
|
|
"8263", "전북", |
213
|
|
|
|
|
|
|
"8262", "광주", |
214
|
|
|
|
|
|
|
"8251", "부산", |
215
|
|
|
|
|
|
|
"8264", "제주", |
216
|
|
|
|
|
|
|
"8233", "강원", |
217
|
|
|
|
|
|
|
"8232", "인천", |
218
|
|
|
|
|
|
|
"8242", "대전", |
219
|
|
|
|
|
|
|
"8243", "충북", |
220
|
|
|
|
|
|
|
"822", "서울", |
221
|
|
|
|
|
|
|
"8244", "세종",}; |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
sub new { |
224
|
25
|
|
|
25
|
1
|
52
|
my $class = shift; |
225
|
25
|
|
|
|
|
45
|
my $number = shift; |
226
|
25
|
|
|
|
|
168
|
$number =~ s/(^\+82|\D)//g; |
227
|
25
|
|
|
|
|
159
|
my $self = bless({ country_code => '82', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
228
|
25
|
100
|
|
|
|
131
|
return $self if ($self->is_valid()); |
229
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0(8(?:[1-46-8]|5\d\d))?)//; |
230
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '82', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
231
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
1; |