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
|
|
1077
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
210
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
20
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
44
|
|
23
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
45
|
|
24
|
2
|
|
|
2
|
|
13
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181421; |
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[1-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{ko} = {"822", "서울", |
189
|
|
|
|
|
|
|
"8231", "경기", |
190
|
|
|
|
|
|
|
"8262", "광주", |
191
|
|
|
|
|
|
|
"8251", "부산", |
192
|
|
|
|
|
|
|
"8232", "인천", |
193
|
|
|
|
|
|
|
"8252", "울산", |
194
|
|
|
|
|
|
|
"8261", "전남", |
195
|
|
|
|
|
|
|
"8244", "세종", |
196
|
|
|
|
|
|
|
"8243", "충북", |
197
|
|
|
|
|
|
|
"8264", "제주", |
198
|
|
|
|
|
|
|
"8241", "충남", |
199
|
|
|
|
|
|
|
"8263", "전북", |
200
|
|
|
|
|
|
|
"8255", "경남", |
201
|
|
|
|
|
|
|
"8242", "대전", |
202
|
|
|
|
|
|
|
"8254", "경북", |
203
|
|
|
|
|
|
|
"8233", "강원", |
204
|
|
|
|
|
|
|
"8253", "대구",}; |
205
|
|
|
|
|
|
|
$areanames{en} = {"822", "Seoul", |
206
|
|
|
|
|
|
|
"8231", "Gyeonggi", |
207
|
|
|
|
|
|
|
"8251", "Busan", |
208
|
|
|
|
|
|
|
"8262", "Gwangju", |
209
|
|
|
|
|
|
|
"8243", "Chungbuk", |
210
|
|
|
|
|
|
|
"8232", "Incheon", |
211
|
|
|
|
|
|
|
"8252", "Ulsan", |
212
|
|
|
|
|
|
|
"8261", "Jeonnam", |
213
|
|
|
|
|
|
|
"8244", "Sejong\ City", |
214
|
|
|
|
|
|
|
"8263", "Jeonbuk", |
215
|
|
|
|
|
|
|
"8255", "Gyeongnam", |
216
|
|
|
|
|
|
|
"8264", "Jeju", |
217
|
|
|
|
|
|
|
"8241", "Chungnam", |
218
|
|
|
|
|
|
|
"8233", "Gangwon", |
219
|
|
|
|
|
|
|
"8253", "Daegu", |
220
|
|
|
|
|
|
|
"8242", "Daejeon", |
221
|
|
|
|
|
|
|
"8254", "Gyeongbuk",}; |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
sub new { |
224
|
25
|
|
|
25
|
1
|
43
|
my $class = shift; |
225
|
25
|
|
|
|
|
41
|
my $number = shift; |
226
|
25
|
|
|
|
|
156
|
$number =~ s/(^\+82|\D)//g; |
227
|
25
|
|
|
|
|
137
|
my $self = bless({ country_code => '82', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
228
|
25
|
100
|
|
|
|
107
|
return $self if ($self->is_valid()); |
229
|
1
|
|
|
|
|
4
|
$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
|
|
|
|
7
|
return $self->is_valid() ? $self : undef; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
1; |