<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># 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::TW;
use base qw(Number::Phone::StubCountry);

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

my $formatters = [
                {
                  'format' =&gt; '$1 $2 $3',
                  'leading_digits' =&gt; '202',
                  'national_rule' =&gt; '0$1',
                  'pattern' =&gt; '(\\d{2})(\\d)(\\d{4})'
                },
                {
                  'format' =&gt; '$1 $2 $3',
                  'leading_digits' =&gt; '[258]0',
                  'national_rule' =&gt; '0$1',
                  'pattern' =&gt; '(\\d{2})(\\d{3})(\\d{3,4})'
                },
                {
                  'format' =&gt; '$1 $2 $3',
                  'leading_digits' =&gt; '
            [23568]|
            4(?:
              0[2-48]|
              [1-47-9]
            )|
            (?:
              400|
              7
            )[1-9]
          ',
                  'national_rule' =&gt; '0$1',
                  'pattern' =&gt; '(\\d)(\\d{3,4})(\\d{4})'
                },
                {
                  'format' =&gt; '$1 $2 $3',
                  'leading_digits' =&gt; '[49]',
                  'national_rule' =&gt; '0$1',
                  'pattern' =&gt; '(\\d{3})(\\d{3})(\\d{3})'
                },
                {
                  'format' =&gt; '$1 $2 $3',
                  'leading_digits' =&gt; '7',
                  'national_rule' =&gt; '0$1',
                  'pattern' =&gt; '(\\d{2})(\\d{4})(\\d{4,5})'
                }
              ];

my $validators = {
                'fixed_line' =&gt; '
          (?:
            2[2-8]\\d|
            370|
            55[01]|
            7[1-9]
          )\\d{6}|
          4(?:
            (?:
              0(?:
                0[1-9]|
                [2-48]\\d
              )|
              1[023]\\d
            )\\d{4,5}|
            (?:
              [239]\\d\\d|
              4(?:
                0[56]|
                12|
                49
              )
            )\\d{5}
          )|
          6(?:
            [01]\\d{7}|
            4(?:
              0[56]|
              12|
              24|
              4[09]
            )\\d{4,5}
          )|
          8(?:
            (?:
              2(?:
                3\\d|
                4[0-269]|
                [578]0|
                66
              )|
              36[24-9]|
              90\\d\\d
            )\\d{4}|
            4(?:
              0[56]|
              12|
              24|
              4[09]
            )\\d{4,5}
          )|
          (?:
            2(?:
              2(?:
                0\\d\\d|
                4(?:
                  0[68]|
                  [249]0|
                  3[0-467]|
                  5[0-25-9]|
                  6[0235689]
                )
              )|
              (?:
                3(?:
                  [09]\\d|
                  1[0-4]
                )|
                (?:
                  4\\d|
                  5[0-49]|
                  6[0-29]|
                  7[0-5]
                )\\d
              )\\d
            )|
            (?:
              (?:
                3[2-9]|
                5[2-8]|
                6[0-35-79]|
                8[7-9]
              )\\d\\d|
              4(?:
                2(?:
                  [089]\\d|
                  7[1-9]
                )|
                (?:
                  3[0-4]|
                  [78]\\d|
                  9[01]
                )\\d
              )
            )\\d
          )\\d{3}
        ',
                'geographic' =&gt; '
          (?:
            2[2-8]\\d|
            370|
            55[01]|
            7[1-9]
          )\\d{6}|
          4(?:
            (?:
              0(?:
                0[1-9]|
                [2-48]\\d
              )|
              1[023]\\d
            )\\d{4,5}|
            (?:
              [239]\\d\\d|
              4(?:
                0[56]|
                12|
                49
              )
            )\\d{5}
          )|
          6(?:
            [01]\\d{7}|
            4(?:
              0[56]|
              12|
              24|
              4[09]
            )\\d{4,5}
          )|
          8(?:
            (?:
              2(?:
                3\\d|
                4[0-269]|
                [578]0|
                66
              )|
              36[24-9]|
              90\\d\\d
            )\\d{4}|
            4(?:
              0[56]|
              12|
              24|
              4[09]
            )\\d{4,5}
          )|
          (?:
            2(?:
              2(?:
                0\\d\\d|
                4(?:
                  0[68]|
                  [249]0|
                  3[0-467]|
                  5[0-25-9]|
                  6[0235689]
                )
              )|
              (?:
                3(?:
                  [09]\\d|
                  1[0-4]
                )|
                (?:
                  4\\d|
                  5[0-49]|
                  6[0-29]|
                  7[0-5]
                )\\d
              )\\d
            )|
            (?:
              (?:
                3[2-9]|
                5[2-8]|
                6[0-35-79]|
                8[7-9]
              )\\d\\d|
              4(?:
                2(?:
                  [089]\\d|
                  7[1-9]
                )|
                (?:
                  3[0-4]|
                  [78]\\d|
                  9[01]
                )\\d
              )
            )\\d
          )\\d{3}
        ',
                'mobile' =&gt; '
          (?:
            40001[0-2]|
            9[0-8]\\d{4}
          )\\d{3}
        ',
                'pager' =&gt; '',
                'personal_number' =&gt; '99\\d{7}',
                'specialrate' =&gt; '(
          20(?:
            [013-9]\\d\\d|
            2
          )\\d{4}
        )|(50[0-46-9]\\d{6})',
                'toll_free' =&gt; '
          80[0-79]\\d{6}|
          800\\d{5}
        ',
                'voip' =&gt; '
          7010(?:
            [0-2679]\\d|
            3[0-7]|
            8[0-5]
          )\\d{5}|
          70\\d{8}
        '
              };
my %areanames = ();
$areanames{zh} = {"88680", "å±æ±",
"88643", "è‡ºä¸­\ã€å½°åŒ–",
"886825", "é‡‘é—¨",
"88673", "é«˜é›„",
"88687", "å±æ±",
"886823", "é‡‘é–€",
"8868230", "å±ä¸œ",
"8864003", "å°ä¸­\ã€å½°åŒ–",
"8863", "æ¡ƒåœ’\ã€æ–°ç«¹\ã€èŠ±è“®\ã€å®œè˜­",
"8864006", "å°ä¸­\ã€å½°åŒ–",
"88647", "è‡ºä¸­\ã€å½°åŒ–",
"886402", "å°ä¸­\ã€å½°åŒ–",
"88677", "é«˜é›„",
"88683", "é¦¬ç¥–",
"8865", "å˜‰ç¾©\ã€é›²æž—",
"88656", "å˜‰ä¹‰\ã€äº‘æž—",
"88655", "å˜‰ä¹‰\ã€äº‘æž—",
"88689", "è‡ºæ±",
"8862", "è‡ºåŒ—",
"88642", "è‡ºä¸­\ã€å½°åŒ–",
"88672", "é«˜é›„",
"88688", "å±æ±",
"886826", "çƒåµ",
"886403", "å°ä¸­\ã€å½°åŒ–",
"88654", "å˜‰ä¹‰\ã€äº‘æž—",
"88648", "è‡ºä¸­\ã€å½°åŒ–",
"88679", "é«˜é›„",
"8864005", "å°ä¸­\ã€å½°åŒ–",
"88678", "é«˜é›„",
"88649", "å—æŠ•",
"886404", "å°ä¸­\ã€å½°åŒ–",
"88641", "å°ä¸­\ã€å½°åŒ–",
"8864002", "å°ä¸­\ã€å½°åŒ–",
"88671", "é«˜é›„",
"8866", "è‡ºå—\ã€æ¾Žæ¹–",
"88653", "å˜‰ä¹‰\ã€äº‘æž—",
"8864009", "å°ä¸­\ã€å½°åŒ–",
"8864008", "å°ä¸­\ã€å½°åŒ–",
"88637", "è‹—æ&nbsp;—",
"88657", "å˜‰ä¹‰\ã€äº‘æž—",
"88676", "é«˜é›„",
"8867", "é«˜é›„",
"886408", "å°ä¸­\ã€å½°åŒ–",
"88675", "é«˜é›„",
"886824", "é‡‘é—¨",
"886827", "é‡‘é—¨",
"88644", "å°ä¸­\ã€å½°åŒ–",
"8864004", "å°ä¸­\ã€å½°åŒ–",
"88652", "å˜‰ä¹‰\ã€äº‘æž—",
"88674", "é«˜é›„",
"8864007", "å°ä¸­\ã€å½°åŒ–",
"8864001", "å°ä¸­\ã€å½°åŒ–",
"88658", "å˜‰ä¹‰\ã€äº‘æž—",
"886828", "é‡‘é—¨",
"88684", "å±ä¸œ",};
$areanames{en} = {"88641", "Taichung\/Changhua",
"8864002", "Taichung\/Changhua",
"886404", "Taichung\/Changhua",
"88653", "Chiayi\/Yunlin",
"8866", "Tainan\/Penghu",
"88671", "Kaohsiung",
"88637", "Miaoli",
"8864008", "Taichung\/Changhua",
"8864009", "Taichung\/Changhua",
"88675", "Kaohsiung",
"886408", "Taichung\/Changhua",
"88676", "Kaohsiung",
"88657", "Chiayi\/Yunlin",
"88644", "Taichung\/Changhua",
"886827", "Kinmen",
"886824", "Kinmen",
"88674", "Kaohsiung",
"88652", "Chiayi\/Yunlin",
"8864004", "Taichung\/Changhua",
"88684", "Pingtung",
"886828", "Kinmen",
"88658", "Chiayi\/Yunlin",
"8864007", "Taichung\/Changhua",
"8864001", "Taichung\/Changhua",
"88643", "Taichung\/Changhua",
"88680", "Pingtung",
"886823", "Kinmen",
"88687", "Pingtung",
"88673", "Kaohsiung",
"886825", "Kinmen",
"88647", "Taichung\/Changhua",
"8864006", "Taichung\/Changhua",
"8863", "Taoyuan\/Hsinchu\/Yilan\/Hualien",
"8864003", "Taichung\/Changhua",
"88655", "Chiayi\/Yunlin",
"88656", "Chiayi\/Yunlin",
"88683", "Matsu",
"886402", "Taichung\/Changhua",
"88677", "Kaohsiung",
"88642", "Taichung\/Changhua",
"8862", "Taipei",
"88689", "Taitung",
"886403", "Taichung\/Changhua",
"88654", "Chiayi\/Yunlin",
"88688", "Pingtung",
"886826", "Wuqiu",
"88672", "Kaohsiung",
"8864005", "Taichung\/Changhua",
"88679", "Kaohsiung",
"88648", "Taichung\/Changhua",
"88649", "Nantou",
"88678", "Kaohsiung",};

    sub new {
      my $class = shift;
      my $number = shift;
      $number =~ s/(^\+886|\D)//g;
      my $self = bless({ number =&gt; $number, formatters =&gt; $formatters, validators =&gt; $validators, areanames =&gt; \%areanames}, $class);
      return $self if ($self-&gt;is_valid());
      $number =~ s/^(?:0)//;
      $self = bless({ number =&gt; $number, formatters =&gt; $formatters, validators =&gt; $validators, areanames =&gt; \%areanames}, $class);
      return $self-&gt;is_valid() ? $self : undef;
    }
1;</pre></body></html>