|
our $VERSION = 1.20250323211836;
my $formatters = [
{
'format' => '$1 $2 $3' ,
'leading_digits' => '
[1-4]|
5[1-3]
',
'national_rule' => '0$1' ,
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})'
},
{
'format' => '$1 $2 $3' ,
'leading_digits' => '[59]' ,
'national_rule' => '0$1' ,
'pattern' => '(\\d{3})(\\d{3})(\\d{3})'
}
];
my $validators = {
'fixed_line' => '
21\\d{6,7}|
(?:
1(?:
[14]\\d|
[2356]
)|
2[235]|
3(?:
[13]\\d|
4
)|
4[134]|
5[1-3]
)\\d{6}
',
'geographic' => '
21\\d{6,7}|
(?:
1(?:
[14]\\d|
[2356]
)|
2[235]|
3(?:
[13]\\d|
4
)|
4[134]|
5[1-3]
)\\d{6}
',
'mobile' => '
(?:
50|
9[1-689]
)\\d{7}
',
'pager' => '' ,
'personal_number' => '' ,
'specialrate' => '' ,
'toll_free' => '' ,
'voip' => ''
};
my %areanames = ();
$areanames {en} = { "96343" , "Tartous" ,
"96344" , "Hamah" ,
"96311" , "Damascus\ and\ rural\ areas" ,
"96353" , "Al\-Kameshli" ,
"96334" , "Palmyra" ,
"96333" , "Hamah" ,
"96325" , "Menbej" ,
"96312" , "Al\-Nebek" ,
"96323" , "Edleb" ,
"96351" , "Deir\ Ezzour" ,
"96314" , "Al\-Quneitra" ,
"96313" , "Al\-Zabadani" ,
"96316" , "Al\-Swedaa" ,
"96341" , "Lattakia" ,
"96322" , "Al\-Rakkah" ,
"96315" , "Dara" ,
"96321" , "Aleppo" ,
"96352" , "Alhasakah" ,
"96331" , "Homs" ,};
my $timezones = {
'' => [
'Asia/Damascus'
]
};
sub new {
my $class = shift ;
my $number = shift ;
$number =~ s/(^\+963|\D)//g;
my $self = bless ({ country_code => '963' , number => $number , formatters => $formatters , validators => $validators , timezones => $timezones , areanames => \ %areanames }, $class );
return $self if ( $self ->is_valid());
$number =~ s/^(?:0)//;
$self = bless ({ country_code => '963' , number => $number , formatters => $formatters , validators => $validators , areanames => \ %areanames }, $class );
return $self ->is_valid() ? $self : undef ;
}
1;
|