| 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::NP; |
|
20
|
2
|
|
|
2
|
|
1309
|
use base qw(Number::Phone::StubCountry); |
|
|
2
|
|
|
|
|
16
|
|
|
|
2
|
|
|
|
|
243
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
17
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
54
|
|
|
23
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
55
|
|
|
24
|
2
|
|
|
2
|
|
13
|
use utf8; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
22
|
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
|
28
|
|
|
|
|
|
|
{ |
|
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
|
30
|
|
|
|
|
|
|
'leading_digits' => '1[2-6]', |
|
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
|
32
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{7})' |
|
33
|
|
|
|
|
|
|
}, |
|
34
|
|
|
|
|
|
|
{ |
|
35
|
|
|
|
|
|
|
'format' => '$1-$2', |
|
36
|
|
|
|
|
|
|
'leading_digits' => ' |
|
37
|
|
|
|
|
|
|
1[01]| |
|
38
|
|
|
|
|
|
|
[2-8]| |
|
39
|
|
|
|
|
|
|
9(?: |
|
40
|
|
|
|
|
|
|
[1-59]| |
|
41
|
|
|
|
|
|
|
[67][2-6] |
|
42
|
|
|
|
|
|
|
) |
|
43
|
|
|
|
|
|
|
', |
|
44
|
|
|
|
|
|
|
'national_rule' => '0$1', |
|
45
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{6})' |
|
46
|
|
|
|
|
|
|
}, |
|
47
|
|
|
|
|
|
|
{ |
|
48
|
|
|
|
|
|
|
'format' => '$1-$2', |
|
49
|
|
|
|
|
|
|
'leading_digits' => '9', |
|
50
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{7})' |
|
51
|
|
|
|
|
|
|
}, |
|
52
|
|
|
|
|
|
|
{ |
|
53
|
|
|
|
|
|
|
'format' => '$1-$2-$3', |
|
54
|
|
|
|
|
|
|
'intl_format' => 'NA', |
|
55
|
|
|
|
|
|
|
'leading_digits' => '1', |
|
56
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{2})(\\d{5})' |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
]; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $validators = { |
|
61
|
|
|
|
|
|
|
'fixed_line' => ' |
|
62
|
|
|
|
|
|
|
(?: |
|
63
|
|
|
|
|
|
|
1[0-6]\\d| |
|
64
|
|
|
|
|
|
|
99[02-6] |
|
65
|
|
|
|
|
|
|
)\\d{5}| |
|
66
|
|
|
|
|
|
|
(?: |
|
67
|
|
|
|
|
|
|
2[13-79]| |
|
68
|
|
|
|
|
|
|
3[135-8]| |
|
69
|
|
|
|
|
|
|
4[146-9]| |
|
70
|
|
|
|
|
|
|
5[135-7]| |
|
71
|
|
|
|
|
|
|
6[13-9]| |
|
72
|
|
|
|
|
|
|
7[15-9]| |
|
73
|
|
|
|
|
|
|
8[1-46-9]| |
|
74
|
|
|
|
|
|
|
9[1-7] |
|
75
|
|
|
|
|
|
|
)[2-6]\\d{5} |
|
76
|
|
|
|
|
|
|
', |
|
77
|
|
|
|
|
|
|
'geographic' => ' |
|
78
|
|
|
|
|
|
|
(?: |
|
79
|
|
|
|
|
|
|
1[0-6]\\d| |
|
80
|
|
|
|
|
|
|
99[02-6] |
|
81
|
|
|
|
|
|
|
)\\d{5}| |
|
82
|
|
|
|
|
|
|
(?: |
|
83
|
|
|
|
|
|
|
2[13-79]| |
|
84
|
|
|
|
|
|
|
3[135-8]| |
|
85
|
|
|
|
|
|
|
4[146-9]| |
|
86
|
|
|
|
|
|
|
5[135-7]| |
|
87
|
|
|
|
|
|
|
6[13-9]| |
|
88
|
|
|
|
|
|
|
7[15-9]| |
|
89
|
|
|
|
|
|
|
8[1-46-9]| |
|
90
|
|
|
|
|
|
|
9[1-7] |
|
91
|
|
|
|
|
|
|
)[2-6]\\d{5} |
|
92
|
|
|
|
|
|
|
', |
|
93
|
|
|
|
|
|
|
'mobile' => ' |
|
94
|
|
|
|
|
|
|
9(?: |
|
95
|
|
|
|
|
|
|
6[0-3]| |
|
96
|
|
|
|
|
|
|
7[024-6]| |
|
97
|
|
|
|
|
|
|
8[0-24-68] |
|
98
|
|
|
|
|
|
|
)\\d{7} |
|
99
|
|
|
|
|
|
|
', |
|
100
|
|
|
|
|
|
|
'pager' => '', |
|
101
|
|
|
|
|
|
|
'personal_number' => '', |
|
102
|
|
|
|
|
|
|
'specialrate' => '', |
|
103
|
|
|
|
|
|
|
'toll_free' => ' |
|
104
|
|
|
|
|
|
|
1(?: |
|
105
|
|
|
|
|
|
|
66001| |
|
106
|
|
|
|
|
|
|
800\\d\\d |
|
107
|
|
|
|
|
|
|
)\\d{5} |
|
108
|
|
|
|
|
|
|
', |
|
109
|
|
|
|
|
|
|
'voip' => '' |
|
110
|
|
|
|
|
|
|
}; |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub new { |
|
113
|
10
|
|
|
10
|
1
|
23
|
my $class = shift; |
|
114
|
10
|
|
|
|
|
18
|
my $number = shift; |
|
115
|
10
|
|
|
|
|
69
|
$number =~ s/(^\+977|\D)//g; |
|
116
|
10
|
|
|
|
|
56
|
my $self = bless({ country_code => '977', number => $number, formatters => $formatters, validators => $validators, }, $class); |
|
117
|
10
|
100
|
|
|
|
53
|
return $self if ($self->is_valid()); |
|
118
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
|
119
|
1
|
|
|
|
|
14
|
$self = bless({ country_code => '977', number => $number, formatters => $formatters, validators => $validators, }, $class); |
|
120
|
1
|
50
|
|
|
|
3
|
return $self->is_valid() ? $self : undef; |
|
121
|
|
|
|
|
|
|
} |
|
122
|
|
|
|
|
|
|
1; |