| 1 | # automatically generated file, don't edit | ||||||||||
| 2 | |||||||||||
| 3 | |||||||||||
| 4 | |||||||||||
| 5 | # Copyright 2026 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::LB; | ||||||||||
| 20 | 2 | ▶ | use base qw(Number::Phone::StubCountry); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 2 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 2 | our $VERSION = 1.20260904101550; | |||||||||
| 26 | |||||||||||
| 27 | 2 | my $formatters = [ | |||||||||
| 28 | { | ||||||||||
| 29 | 'format' => '$1 $2 $3', | ||||||||||
| 30 | 'leading_digits' => ' | ||||||||||
| 31 | [13-69]| | ||||||||||
| 32 | 7(?: | ||||||||||
| 33 | [2-57]| | ||||||||||
| 34 | 62| | ||||||||||
| 35 | 8[0-6]| | ||||||||||
| 36 | 9[04-9] | ||||||||||
| 37 | )| | ||||||||||
| 38 | 8[02-9] | ||||||||||
| 39 | ', | ||||||||||
| 40 | 'national_rule' => '0$1', | ||||||||||
| 41 | 'pattern' => '(\\d)(\\d{3})(\\d{3})' | ||||||||||
| 42 | }, | ||||||||||
| 43 | { | ||||||||||
| 44 | 'format' => '$1 $2 $3', | ||||||||||
| 45 | 'leading_digits' => '[27-9]', | ||||||||||
| 46 | 'pattern' => '(\\d{2})(\\d{3})(\\d{3})' | ||||||||||
| 47 | } | ||||||||||
| 48 | ]; | ||||||||||
| 49 | |||||||||||
| 50 | 2 | my $validators = { | |||||||||
| 51 | 'fixed_line' => ' | ||||||||||
| 52 | 7(?: | ||||||||||
| 53 | 62| | ||||||||||
| 54 | 8[0-6]| | ||||||||||
| 55 | 9[04-9] | ||||||||||
| 56 | )\\d{4}| | ||||||||||
| 57 | (?: | ||||||||||
| 58 | [14-69]\\d| | ||||||||||
| 59 | 2(?: | ||||||||||
| 60 | [14-69]\\d| | ||||||||||
| 61 | [78][1-9] | ||||||||||
| 62 | )| | ||||||||||
| 63 | 7[2-57]| | ||||||||||
| 64 | 8[02-9] | ||||||||||
| 65 | )\\d{5} | ||||||||||
| 66 | ', | ||||||||||
| 67 | 'geographic' => ' | ||||||||||
| 68 | 7(?: | ||||||||||
| 69 | 62| | ||||||||||
| 70 | 8[0-6]| | ||||||||||
| 71 | 9[04-9] | ||||||||||
| 72 | )\\d{4}| | ||||||||||
| 73 | (?: | ||||||||||
| 74 | [14-69]\\d| | ||||||||||
| 75 | 2(?: | ||||||||||
| 76 | [14-69]\\d| | ||||||||||
| 77 | [78][1-9] | ||||||||||
| 78 | )| | ||||||||||
| 79 | 7[2-57]| | ||||||||||
| 80 | 8[02-9] | ||||||||||
| 81 | )\\d{5} | ||||||||||
| 82 | ', | ||||||||||
| 83 | 'mobile' => ' | ||||||||||
| 84 | (?: | ||||||||||
| 85 | (?: | ||||||||||
| 86 | 3| | ||||||||||
| 87 | 81 | ||||||||||
| 88 | )\\d| | ||||||||||
| 89 | 7(?: | ||||||||||
| 90 | [01]\\d| | ||||||||||
| 91 | 6[013-9]| | ||||||||||
| 92 | 8[7-9]| | ||||||||||
| 93 | 9[0-4] | ||||||||||
| 94 | ) | ||||||||||
| 95 | )\\d{5} | ||||||||||
| 96 | ', | ||||||||||
| 97 | 'pager' => '', | ||||||||||
| 98 | 'personal_number' => '', | ||||||||||
| 99 | 'specialrate' => '(80\\d{6})|(9[01]\\d{6})', | ||||||||||
| 100 | 'toll_free' => '', | ||||||||||
| 101 | 'voip' => '' | ||||||||||
| 102 | }; | ||||||||||
| 103 | 2 | my %areanames = (); | |||||||||
| 104 | 2 | $areanames{en} = {"96121", "Beirut", | |||||||||
| 105 | "96125", "Chouf", | ||||||||||
| 106 | "96128", "Bekaa", | ||||||||||
| 107 | "96129", "Jbeil\ \&\ Keserwan", | ||||||||||
| 108 | "96127", "South\ Lebanon", | ||||||||||
| 109 | "96126", "North\ Lebanon", | ||||||||||
| 110 | "96124", "Metn",}; | ||||||||||
| 111 | 2 | my $timezones = { | |||||||||
| 112 | '' => [ | ||||||||||
| 113 | 'Asia/Beirut' | ||||||||||
| 114 | ] | ||||||||||
| 115 | }; | ||||||||||
| 116 | |||||||||||
| 117 | 13 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 118 | 13 | my $class = shift; | |||||||||
| 119 | 13 | my $number = shift; | |||||||||
| 120 | 13 | $number =~ s/(^\+961|\D)//g; | |||||||||
| 121 | 13 | my $self = bless({ country_code => '961', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 122 | 13 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 123 | 1 | $number =~ s/^(?:0)//; | |||||||||
| 124 | 1 | $self = bless({ country_code => '961', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 125 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 126 | } | ||||||||||
| 127 | 2 | 1; | |||||||||