The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
# automatically generated file, don't edit



# Copyright 2011 David Cantrell, derived from data from libphonenumber
# http://code.google.com/p/libphonenumber/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package Number::Phone::StubCountry::AZ;
use base qw(Number::Phone::StubCountry);

use strict;
use warnings;
use utf8;
our $VERSION = 1.20180619214153;

my $formatters = [
                {
                  'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})',
                  'leading_digits' => '
            1[28]|
            2(?:
              [0-36]|
              [45]2
            )|
            365
          ',
                  'format' => '$1 $2 $3 $4',
                  'national_rule' => '(0$1)'
                },
                {
                  'format' => '$1 $2 $3 $4',
                  'national_rule' => '0$1',
                  'leading_digits' => '[4-8]',
                  'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})'
                },
                {
                  'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})',
                  'leading_digits' => '9',
                  'format' => '$1 $2 $3 $4',
                  'national_rule' => '0$1'
                }
              ];

my $validators = {
                'mobile' => '
          (?:
            36554|
            (?:
              4[04]|
              5[015]|
              60|
              7[07]
            )\\d{3}
          )\\d{4}
        ',
                'specialrate' => '(900200\\d{3})',
                'pager' => '',
                'geographic' => '
          (?:
            1[28]\\d{3}|
            2(?:
              02|
              1[24]|
              2[2-4]|
              33|
              [45]2|
              6[23]
            )\\d{2}|
            365(?:
              [0-46-9]\\d|
              5[0-35-9]
            )
          )\\d{4}
        ',
                'fixed_line' => '
          (?:
            1[28]\\d{3}|
            2(?:
              02|
              1[24]|
              2[2-4]|
              33|
              [45]2|
              6[23]
            )\\d{2}|
            365(?:
              [0-46-9]\\d|
              5[0-35-9]
            )
          )\\d{4}
        ',
                'toll_free' => '88\\d{7}',
                'personal_number' => '',
                'voip' => ''
              };
my %areanames = (
  99412 => "Baku",
  99418 => "Sumgayit",
  9942020 => "Barda",
  9942021 => "Ujar",
  9942022 => "Agsu",
  9942023 => "Agdash",
  9942024 => "Gobustan",
  9942025 => "Kurdamir",
  9942026 => "Shamakhi",
  9942027 => "Goychay",
  9942028 => "Ismayilli",
  9942029 => "Zardab",
  9942120 => "Hajigabul",
  9942121 => "Shirvan",
  9942122 => "Beylagan",
  9942123 => "Sabirabad",
  9942124 => "Imishli",
  9942125 => "Salyan",
  9942126 => "Neftchala",
  9942127 => "Agjabadi",
  9942128 => "Saatli",
  99421428 => "Hajigabul",
  9942220 => "Goygol",
  9942221 => "Dashkasan",
  9942222 => "Agstafa",
  9942223 => "Tartar",
  9942224 => "Goranboy",
  9942225 => "Ganja",
  9942226 => "Ganja",
  9942227 => "Samukh",
  9942229 => "Gazakh",
  9942230 => "Shamkir",
  9942231 => "Tovuz",
  9942232 => "Gadabay",
  9942233 => "Yevlakh",
  9942235 => "Naftalan",
  99422428 => "Agstafa\/Ganja\/Yevlakh",
  9942330 => "Siyazan",
  9942331 => "Khizi",
  9942332 => "Khachmaz",
  9942333 => "Guba",
  9942335 => "Shabran",
  9942338 => "Gusar",
  9942420 => "Gabala",
  9942421 => "Oguz",
  9942422 => "Zagatala",
  9942424 => "Shaki",
  9942425 => "Gakh",
  9942427 => "Mingachevir",
  9942429 => "Balakan",
  9942520 => "Yardimli",
  9942521 => "Masalli",
  9942522 => "Astara",
  9942524 => "Jalilabad",
  9942525 => "Lankaran",
  9942527 => "Lerik",
  9942529 => "Bilasuvar",
  9942620 => "Khojali",
  9942621 => "Lachin",
  9942622 => "Khankandi",
  9942623 => "Qubadli",
  9942624 => "Askaran",
  9942625 => "Zangilan",
  9942626 => "Shusha",
  9942627 => "Kalbajar",
  9942628 => "Agdara",
  9942629 => "Khojavand",
  9942630 => "Hadrut",
  9942631 => "Fuzuli",
  9942632 => "Agdam",
  9942638 => "Jabrayil",
  99436541 => "Babek",
  99436542 => "Sharur",
  99436543 => "Shahbuz",
  99436544 => "Nakhchivan\ city",
  99436546 => "Julfa",
  99436547 => "Ordubad",
  99436548 => "Kangarli",
  99436549 => "Sadarak",
  99436550 => "Nakhchivan\ city",
  99436552 => "Sharur",
);
    sub new {
      my $class = shift;
      my $number = shift;
      $number =~ s/(^\+994|\D)//g;
      my $self = bless({ number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
      return $self if ($self->is_valid());
      $number =~ s/^(?:0)//;
      $self = bless({ number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
      return $self->is_valid() ? $self : undef;
    }
1;