# 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::IE;
use base qw(Number::Phone::StubCountry);

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

my $formatters = [
                {
                  'format' => '$1 $2',
                  'leading_digits' => '
            2[24-9]|
            47|
            58|
            6[237-9]|
            9[35-9]
          ',
                  'national_rule' => '(0$1)',
                  'pattern' => '(\\d{2})(\\d{5})'
                },
                {
                  'pattern' => '(\\d{3})(\\d{5})',
                  'national_rule' => '(0$1)',
                  'format' => '$1 $2',
                  'leading_digits' => '[45]0'
                },
                {
                  'format' => '$1 $2 $3',
                  'leading_digits' => '1',
                  'national_rule' => '(0$1)',
                  'pattern' => '(\\d)(\\d{3,4})(\\d{4})'
                },
                {
                  'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})',
                  'national_rule' => '(0$1)',
                  'format' => '$1 $2 $3',
                  'leading_digits' => '
            [2569]|
            4[1-69]|
            7[14]
          '
                },
                {
                  'pattern' => '(\\d{2})(\\d{3})(\\d{4})',
                  'national_rule' => '0$1',
                  'leading_digits' => '
            76|
            8[235-9]
          ',
                  'format' => '$1 $2 $3'
                },
                {
                  'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
                  'national_rule' => '0$1',
                  'leading_digits' => '7',
                  'format' => '$1 $2 $3'
                },
                {
                  'format' => '$1 $2 $3',
                  'leading_digits' => '81',
                  'national_rule' => '(0$1)',
                  'pattern' => '(\\d{3})(\\d{3})(\\d{3})'
                },
                {
                  'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
                  'national_rule' => '(0$1)',
                  'leading_digits' => '4',
                  'format' => '$1 $2 $3'
                },
                {
                  'pattern' => '(\\d{4})(\\d{3})(\\d{3})',
                  'format' => '$1 $2 $3',
                  'leading_digits' => '1'
                },
                {
                  'pattern' => '(\\d{2})(\\d)(\\d{3})(\\d{4})',
                  'format' => '$1 $2 $3 $4',
                  'leading_digits' => '8',
                  'national_rule' => '0$1'
                }
              ];

my $validators = {
                'pager' => '',
                'mobile' => '
          8(?:
            22|
            [35-9]\\d
          )\\d{6}
        ',
                'voip' => '76\\d{7}',
                'toll_free' => '1800\\d{6}',
                'geographic' => '
          (?:
            1\\d{2,3}|
            2(?:
              [13]\\d\\d|
              [24-9]
            )|
            4(?:
              0[24]|
              (?:
                (?:
                  [1-469]|
                  8[0-46-9]
                )\\d|
                5
              )\\d|
              7
            )|
            5(?:
              0[45]|
              (?:
                1|
                [23679]\\d
              )\\d|
              8
            )|
            6(?:
              [237-9]|
              [4-6]\\d\\d
            )|
            7[14]\\d\\d|
            9(?:
              [04]\\d\\d|
              [35-9]
            )
          )\\d{5}|
          [269]1\\d{6}
        ',
                'personal_number' => '700\\d{6}',
                'specialrate' => '(18[59]0\\d{6})|(
          15(?:
            1[2-8]|
            [2-8]0|
            9[089]
          )\\d{6}
        )|(818\\d{6})',
                'fixed_line' => '
          (?:
            1\\d{2,3}|
            2(?:
              [13]\\d\\d|
              [24-9]
            )|
            4(?:
              0[24]|
              (?:
                (?:
                  [1-469]|
                  8[0-46-9]
                )\\d|
                5
              )\\d|
              7
            )|
            5(?:
              0[45]|
              (?:
                1|
                [23679]\\d
              )\\d|
              8
            )|
            6(?:
              [237-9]|
              [4-6]\\d\\d
            )|
            7[14]\\d\\d|
            9(?:
              [04]\\d\\d|
              [35-9]
            )
          )\\d{5}|
          [269]1\\d{6}
        '
              };
my %areanames = (
  3531 => "Dublin",
  35321 => "Cork\/Kinsale\/Coachford",
  35322 => "Mallow",
  35323 => "Bandon",
  35324 => "Youghal",
  35325 => "Fermoy",
  35326 => "Macroom",
  35327 => "Bantry",
  35328 => "Skibbereen",
  35329 => "Kanturk",
  353402 => "Arklow",
  353404 => "Wicklow",
  35341 => "Drogheda\/Ardee",
  35342 => "Dundalk\/Carrickmacross\/Castleblaney",
  35343 => "Longford\/Granard",
  35344 => "Mullingar\/Castlepollard\/Tyrrellspass",
  35345 => "Naas\/Kildare\/Curragh",
  35346 => "Navan\/Kells\/Trim\/Edenderry\/Enfield",
  35347 => "Monaghan\/Clones",
  35349 => "Cavan\/Cootehill\/Oldcastle\/Belturbet",
  353504 => "Thurles",
  353505 => "Roscrea",
  35351 => "Waterford\/Carrick\-on\-Suir\/New\ Ross\/Kilmacthomas",
  35352 => "Clonmel\/Cahir\/Killenaule",
  35353 => "Wexford\/Enniscorthy\/Ferns\/Gorey",
  35356 => "Kilkenny\/Castlecomer\/Freshford",
  35357 => "Portlaoise\/Abbeyleix\/Tullamore\/Birr",
  35358 => "Dungarvan",
  35359 => "Carlow\/Muine\ Bheag\/Athy\/Baltinglass",
  35361 => "Limerick\/Scariff",
  35362 => "Tipperary\/Cashel",
  35363 => "Charleville",
  35364 => "Killarney\/Rathmore",
  35365 => "Ennis\/Ennistymon\/Kilrush",
  35366 => "Tralee\/Dingle\/Killorglin\/Cahersiveen",
  35367 => "Nenagh",
  35368 => "Listowel",
  35369 => "Newcastle\ West",
  35371 => "Sligo\/Manorhamilton\/Carrick\-on\-Shannon",
  35374 => "Letterkenny\/Donegal\/Dungloe\/Buncrana",
  35390 => "Athlone\/Ballinasloe\/Portumna\/Roscommon",
  35391 => "Galway\/Gort\/Loughrea",
  35393 => "Tuam",
  35394 => "Castlebar\/Claremorris\/Castlerea\/Ballinrobe",
  35395 => "Clifden",
  35396 => "Ballina",
  35397 => "Belmullet",
  35398 => "Westport",
  35399 => "Kilronan",
);
    sub new {
      my $class = shift;
      my $number = shift;
      $number =~ s/(^\+353|\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;