From 15b495e5532bec0e0bf48775bf64f35ed4b5cbec Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Tue, 15 May 2012 16:06:07 +0530 Subject: [PATCH 01/13] Adds missing country code to region code map for global networks --- CountryCodeToRegionCodeMap.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CountryCodeToRegionCodeMap.php b/CountryCodeToRegionCodeMap.php index 778f3db..8b527dc 100644 --- a/CountryCodeToRegionCodeMap.php +++ b/CountryCodeToRegionCodeMap.php @@ -181,6 +181,7 @@ class CountryCodeToRegionCodeMap { 690 => array('TK'), 691 => array('FM'), 692 => array('MH'), + 800 => array('001'), 850 => array('KP'), 852 => array('HK'), 853 => array('MO'), From 5fd667432203108cad8dabec2a336c865e23b70b Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Fri, 18 May 2012 12:26:40 +0530 Subject: [PATCH 02/13] Updates regex for exact matching & x/pcre_extended pattern modifier --- PhoneNumberUtil.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PhoneNumberUtil.php b/PhoneNumberUtil.php index 9c43371..5a9bf32 100644 --- a/PhoneNumberUtil.php +++ b/PhoneNumberUtil.php @@ -759,11 +759,11 @@ public function isAlphaNumber($number) { * length 8, this will return TOO_LONG. */ private function testNumberLengthAgainstPattern($numberPattern, $number) { - $numberMatcher = preg_match('/^' . $numberPattern . '$/', $number); + $numberMatcher = preg_match('/^(' . $numberPattern . ')$/x', $number); if ($numberMatcher > 0) { return ValidationResult::IS_POSSIBLE; } - $numberMatcher = preg_match('/^' . $numberPattern . '/', $number); + $numberMatcher = preg_match('/^(' . $numberPattern . ')/x', $number); if ($numberMatcher > 0) { return ValidationResult::TOO_LONG; } else { @@ -878,8 +878,8 @@ private function maybeExtractCountryCode($number, PhoneMetadata $defaultRegionMe // If the number was not valid before but is valid now, or if it was too long before, we // consider the number with the country calling code stripped to be a better result and // keep that instead. - if ((preg_match('/' . $validNumberPattern . '/', $fullNumber) == 0 && - preg_match('/' . $validNumberPattern . '/', $potentialNationalNumber) > 0) || + if ((preg_match('/^(' . $validNumberPattern . ')$/x', $fullNumber) == 0 && + preg_match('/^(' . $validNumberPattern . ')$/x', $potentialNationalNumber) > 0) || $this->testNumberLengthAgainstPattern($possibleNumberPattern, (string)$fullNumber) == ValidationResult::TOO_LONG) { $nationalNumber .= $potentialNationalNumber; @@ -2272,8 +2272,8 @@ private function getNumberTypeHelper($nationalNumber, PhoneMetadata $metadata) { } private function isNumberMatchingDesc($nationalNumber, PhoneNumberDesc $numberDesc) { - $possibleNumberPatternMatcher = preg_match('/^' . str_replace(array(PHP_EOL, ' '), '', $numberDesc->getPossibleNumberPattern()) . '$/', $nationalNumber); - $nationalNumberPatternMatcher = preg_match('/^' . str_replace(array(PHP_EOL, ' '), '', $numberDesc->getNationalNumberPattern()) . '$/', $nationalNumber); + $possibleNumberPatternMatcher = preg_match('/^(' . $numberDesc->getPossibleNumberPattern() . ')$/x', $nationalNumber); + $nationalNumberPatternMatcher = preg_match('/^' . $numberDesc->getNationalNumberPattern() . '$/x', $nationalNumber); return $possibleNumberPatternMatcher && $nationalNumberPatternMatcher; } @@ -2340,14 +2340,14 @@ public function __construct($pattern, $subject) * @return bool */ public function matches() { - return preg_match('/^(?:' . str_replace('/', '\/', $this->pattern) . ')$/', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0; + return preg_match('/^(?:' . str_replace('/', '\/', $this->pattern) . ')$/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0; } /** * @return bool */ public function lookingAt() { - $this->fullPatternMatchesNumber = preg_match_all('/^(?:' . str_replace('/', '\/', $this->pattern) . ')/', $this->subject, $this->groups, PREG_OFFSET_CAPTURE); + $this->fullPatternMatchesNumber = preg_match_all('/^(?:' . str_replace('/', '\/', $this->pattern) . ')/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE); return $this->fullPatternMatchesNumber > 0; } @@ -2355,7 +2355,7 @@ public function lookingAt() { * @return bool */ public function find() { - return preg_match('/(?:' . str_replace('/', '\/', $this->pattern) . ')/', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0; + return preg_match('/(?:' . str_replace('/', '\/', $this->pattern) . ')/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0; } From ac7b620df9243dd1d407c9a714f416d0edf29c60 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Fri, 18 May 2012 12:43:39 +0530 Subject: [PATCH 03/13] Updates MetaData on Phone Number Plan & formatting rules from GoogleCode --- data/PhoneNumberMetadata_800 | 1 - data/PhoneNumberMetadata_808 | 1 - data/PhoneNumberMetadata_870 | 72 ++++++++++++++++++ data/PhoneNumberMetadata_883 | 1 - data/PhoneNumberMetadata_888 | 1 - data/PhoneNumberMetadata_979 | 1 - data/PhoneNumberMetadata_AC | 6 +- data/PhoneNumberMetadata_AD | 1 - data/PhoneNumberMetadata_AE | 1 - data/PhoneNumberMetadata_AF | 1 - data/PhoneNumberMetadata_AG | 1 - data/PhoneNumberMetadata_AI | 1 - data/PhoneNumberMetadata_AL | 1 - data/PhoneNumberMetadata_AM | 11 ++- data/PhoneNumberMetadata_AN | 1 - data/PhoneNumberMetadata_AO | 3 +- data/PhoneNumberMetadata_AR | 142 +++++++++++++++++++++-------------- data/PhoneNumberMetadata_AS | 1 - data/PhoneNumberMetadata_AT | 3 +- data/PhoneNumberMetadata_AW | 1 - data/PhoneNumberMetadata_AX | 1 - data/PhoneNumberMetadata_AZ | 106 ++++---------------------- data/PhoneNumberMetadata_BA | 1 - data/PhoneNumberMetadata_BB | 1 - data/PhoneNumberMetadata_BE | 6 +- data/PhoneNumberMetadata_BF | 8 +- data/PhoneNumberMetadata_BG | 1 - data/PhoneNumberMetadata_BH | 1 - data/PhoneNumberMetadata_BI | 1 - data/PhoneNumberMetadata_BJ | 1 - data/PhoneNumberMetadata_BL | 1 - data/PhoneNumberMetadata_BM | 1 - data/PhoneNumberMetadata_BN | 1 - data/PhoneNumberMetadata_BO | 1 - data/PhoneNumberMetadata_BQ | 1 - data/PhoneNumberMetadata_BR | 38 +++++++--- data/PhoneNumberMetadata_BS | 1 - data/PhoneNumberMetadata_BT | 1 - data/PhoneNumberMetadata_BW | 1 - data/PhoneNumberMetadata_BY | 2 +- data/PhoneNumberMetadata_BZ | 8 +- data/PhoneNumberMetadata_CA | 7 +- data/PhoneNumberMetadata_CD | 35 ++++++--- data/PhoneNumberMetadata_CF | 1 - data/PhoneNumberMetadata_CG | 1 - data/PhoneNumberMetadata_CH | 1 - data/PhoneNumberMetadata_CI | 3 +- data/PhoneNumberMetadata_CK | 1 - data/PhoneNumberMetadata_CL | 1 - data/PhoneNumberMetadata_CM | 1 - data/PhoneNumberMetadata_CN | 1 - data/PhoneNumberMetadata_CO | 1 - data/PhoneNumberMetadata_CR | 3 +- data/PhoneNumberMetadata_CU | 7 +- data/PhoneNumberMetadata_CV | 1 - data/PhoneNumberMetadata_CW | 1 - data/PhoneNumberMetadata_CY | 1 - data/PhoneNumberMetadata_CZ | 1 - data/PhoneNumberMetadata_DE | 45 ++++++++++- data/PhoneNumberMetadata_DJ | 25 ++---- data/PhoneNumberMetadata_DK | 1 - data/PhoneNumberMetadata_DM | 1 - data/PhoneNumberMetadata_DO | 1 - data/PhoneNumberMetadata_DZ | 1 - data/PhoneNumberMetadata_EC | 1 - data/PhoneNumberMetadata_EE | 3 +- data/PhoneNumberMetadata_EG | 75 ++++++++---------- data/PhoneNumberMetadata_ER | 1 - data/PhoneNumberMetadata_ES | 1 - data/PhoneNumberMetadata_ET | 3 +- data/PhoneNumberMetadata_FI | 1 - data/PhoneNumberMetadata_FK | 1 - data/PhoneNumberMetadata_FM | 1 - data/PhoneNumberMetadata_FO | 1 - data/PhoneNumberMetadata_GA | 3 +- data/PhoneNumberMetadata_GB | 1 - data/PhoneNumberMetadata_GD | 1 - data/PhoneNumberMetadata_GF | 1 - data/PhoneNumberMetadata_GG | 1 - data/PhoneNumberMetadata_GH | 39 +++++++--- data/PhoneNumberMetadata_GI | 1 - data/PhoneNumberMetadata_GL | 1 - data/PhoneNumberMetadata_GM | 10 ++- data/PhoneNumberMetadata_GN | 27 +++++-- data/PhoneNumberMetadata_GP | 1 - data/PhoneNumberMetadata_GQ | 1 - data/PhoneNumberMetadata_GR | 1 - data/PhoneNumberMetadata_GT | 1 - data/PhoneNumberMetadata_GU | 1 - data/PhoneNumberMetadata_GW | 1 - data/PhoneNumberMetadata_GY | 1 - data/PhoneNumberMetadata_HK | 43 +++++++++-- data/PhoneNumberMetadata_HN | 4 +- data/PhoneNumberMetadata_HR | 1 - data/PhoneNumberMetadata_HT | 1 - data/PhoneNumberMetadata_HU | 1 - data/PhoneNumberMetadata_ID | 91 ++++++++++++++++++++-- data/PhoneNumberMetadata_IE | 1 - data/PhoneNumberMetadata_IL | 1 - data/PhoneNumberMetadata_IM | 1 - data/PhoneNumberMetadata_IN | 90 +++++++++++----------- data/PhoneNumberMetadata_IO | 1 - data/PhoneNumberMetadata_IQ | 1 - data/PhoneNumberMetadata_IR | 25 ++++-- data/PhoneNumberMetadata_IS | 1 - data/PhoneNumberMetadata_IT | 7 +- data/PhoneNumberMetadata_JE | 1 - data/PhoneNumberMetadata_JM | 1 - data/PhoneNumberMetadata_JO | 73 ++++++++++++++++-- data/PhoneNumberMetadata_JP | 15 ++-- data/PhoneNumberMetadata_KE | 44 +++++------ data/PhoneNumberMetadata_KG | 3 +- data/PhoneNumberMetadata_KH | 3 +- data/PhoneNumberMetadata_KI | 1 - data/PhoneNumberMetadata_KM | 1 - data/PhoneNumberMetadata_KN | 1 - data/PhoneNumberMetadata_KP | 1 - data/PhoneNumberMetadata_KR | 30 +++++--- data/PhoneNumberMetadata_KW | 3 +- data/PhoneNumberMetadata_KY | 18 ++--- data/PhoneNumberMetadata_LA | 15 ++-- data/PhoneNumberMetadata_LB | 17 +++-- data/PhoneNumberMetadata_LC | 5 +- data/PhoneNumberMetadata_LI | 1 - data/PhoneNumberMetadata_LK | 1 - data/PhoneNumberMetadata_LR | 1 - data/PhoneNumberMetadata_LS | 1 - data/PhoneNumberMetadata_LT | 1 - data/PhoneNumberMetadata_LU | 5 +- data/PhoneNumberMetadata_LV | 1 - data/PhoneNumberMetadata_LY | 1 - data/PhoneNumberMetadata_MA | 8 +- data/PhoneNumberMetadata_MC | 1 - data/PhoneNumberMetadata_MD | 5 +- data/PhoneNumberMetadata_ME | 1 - data/PhoneNumberMetadata_MF | 1 - data/PhoneNumberMetadata_MG | 1 - data/PhoneNumberMetadata_MH | 1 - data/PhoneNumberMetadata_MK | 3 +- data/PhoneNumberMetadata_ML | 1 - data/PhoneNumberMetadata_MM | 32 ++++++-- data/PhoneNumberMetadata_MN | 1 - data/PhoneNumberMetadata_MO | 1 - data/PhoneNumberMetadata_MP | 1 - data/PhoneNumberMetadata_MQ | 1 - data/PhoneNumberMetadata_MR | 1 - data/PhoneNumberMetadata_MS | 3 +- data/PhoneNumberMetadata_MT | 1 - data/PhoneNumberMetadata_MW | 1 - data/PhoneNumberMetadata_MX | 1 - data/PhoneNumberMetadata_MY | 1 - data/PhoneNumberMetadata_MZ | 1 - data/PhoneNumberMetadata_NA | 3 +- data/PhoneNumberMetadata_NC | 1 - data/PhoneNumberMetadata_NE | 3 +- data/PhoneNumberMetadata_NF | 1 - data/PhoneNumberMetadata_NG | 1 - data/PhoneNumberMetadata_NI | 1 - data/PhoneNumberMetadata_NL | 1 - data/PhoneNumberMetadata_NO | 2 +- data/PhoneNumberMetadata_NP | 1 - data/PhoneNumberMetadata_NR | 1 - data/PhoneNumberMetadata_NU | 1 - data/PhoneNumberMetadata_NZ | 47 +++++++----- data/PhoneNumberMetadata_OM | 1 - data/PhoneNumberMetadata_PA | 21 +++--- data/PhoneNumberMetadata_PE | 1 - data/PhoneNumberMetadata_PF | 1 - data/PhoneNumberMetadata_PG | 1 - data/PhoneNumberMetadata_PH | 1 - data/PhoneNumberMetadata_PK | 5 +- data/PhoneNumberMetadata_PL | 1 - data/PhoneNumberMetadata_PM | 1 - data/PhoneNumberMetadata_PR | 1 - data/PhoneNumberMetadata_PS | 1 - data/PhoneNumberMetadata_PT | 1 - data/PhoneNumberMetadata_PW | 1 - data/PhoneNumberMetadata_PY | 1 - data/PhoneNumberMetadata_QA | 1 - data/PhoneNumberMetadata_RE | 1 - data/PhoneNumberMetadata_RO | 1 - data/PhoneNumberMetadata_RS | 1 - data/PhoneNumberMetadata_RW | 1 - data/PhoneNumberMetadata_SA | 3 +- data/PhoneNumberMetadata_SB | 6 +- data/PhoneNumberMetadata_SC | 31 +------- data/PhoneNumberMetadata_SD | 1 - data/PhoneNumberMetadata_SE | 3 +- data/PhoneNumberMetadata_SG | 1 - data/PhoneNumberMetadata_SH | 1 - data/PhoneNumberMetadata_SI | 5 +- data/PhoneNumberMetadata_SJ | 2 +- data/PhoneNumberMetadata_SK | 1 - data/PhoneNumberMetadata_SL | 5 +- data/PhoneNumberMetadata_SM | 1 - data/PhoneNumberMetadata_SN | 4 +- data/PhoneNumberMetadata_SO | 48 ++++++------ data/PhoneNumberMetadata_SR | 1 - data/PhoneNumberMetadata_SS | 1 - data/PhoneNumberMetadata_ST | 1 - data/PhoneNumberMetadata_SV | 1 - data/PhoneNumberMetadata_SX | 1 - data/PhoneNumberMetadata_SY | 14 ++-- data/PhoneNumberMetadata_SZ | 1 - data/PhoneNumberMetadata_TC | 5 +- data/PhoneNumberMetadata_TG | 1 - data/PhoneNumberMetadata_TH | 1 - data/PhoneNumberMetadata_TK | 1 - data/PhoneNumberMetadata_TL | 1 - data/PhoneNumberMetadata_TN | 17 +++-- data/PhoneNumberMetadata_TO | 1 - data/PhoneNumberMetadata_TR | 1 - data/PhoneNumberMetadata_TT | 1 - data/PhoneNumberMetadata_TV | 1 - data/PhoneNumberMetadata_TW | 1 - data/PhoneNumberMetadata_TZ | 1 - data/PhoneNumberMetadata_UG | 1 - data/PhoneNumberMetadata_US | 1 - data/PhoneNumberMetadata_UZ | 3 +- data/PhoneNumberMetadata_VA | 1 - data/PhoneNumberMetadata_VC | 1 - data/PhoneNumberMetadata_VE | 1 - data/PhoneNumberMetadata_VG | 1 - data/PhoneNumberMetadata_VI | 1 - data/PhoneNumberMetadata_VN | 3 +- data/PhoneNumberMetadata_VU | 1 - data/PhoneNumberMetadata_WF | 1 - data/PhoneNumberMetadata_WS | 1 - data/PhoneNumberMetadata_YE | 1 - data/PhoneNumberMetadata_YT | 1 - data/PhoneNumberMetadata_ZA | 1 - data/PhoneNumberMetadata_ZM | 1 - data/PhoneNumberMetadata_ZW | 36 ++++++--- 233 files changed, 893 insertions(+), 768 deletions(-) create mode 100644 data/PhoneNumberMetadata_870 diff --git a/data/PhoneNumberMetadata_800 b/data/PhoneNumberMetadata_800 index a01e866..753a90b 100644 --- a/data/PhoneNumberMetadata_800 +++ b/data/PhoneNumberMetadata_800 @@ -45,7 +45,6 @@ return array ( 'id' => '001', 'countryCode' => 800, 'internationalPrefix' => '', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_808 b/data/PhoneNumberMetadata_808 index da8db01..26a18a9 100644 --- a/data/PhoneNumberMetadata_808 +++ b/data/PhoneNumberMetadata_808 @@ -45,7 +45,6 @@ return array ( 'id' => '001', 'countryCode' => 808, 'internationalPrefix' => '', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_870 b/data/PhoneNumberMetadata_870 new file mode 100644 index 0000000..92773d9 --- /dev/null +++ b/data/PhoneNumberMetadata_870 @@ -0,0 +1,72 @@ + + array ( + 'NationalNumberPattern' => '[35-7]\\d{8}', + 'PossibleNumberPattern' => '\\d{9}', + 'ExampleNumber' => '301234567', + ), + 'fixedLine' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '301234567', + ), + 'mobile' => + array ( + 'NationalNumberPattern' => ' + (?: + [356]\\d| + 7[6-8] + )\\d{7} + ', + 'PossibleNumberPattern' => '\\d{9}', + 'ExampleNumber' => '301234567', + ), + 'tollFree' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '', + ), + 'premiumRate' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '', + ), + 'sharedCost' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '', + ), + 'noInternationalDialling' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '', + ), + 'id' => '001', + 'countryCode' => 870, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => + array ( + 0 => + array ( + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => + array ( + ), + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + ), + ), + 'intlNumberFormat' => + array ( + ), + 'mainCountryForCode' => NULL, + 'leadingZeroPossible' => NULL, +); \ No newline at end of file diff --git a/data/PhoneNumberMetadata_883 b/data/PhoneNumberMetadata_883 index ed1e4cd..7386756 100644 --- a/data/PhoneNumberMetadata_883 +++ b/data/PhoneNumberMetadata_883 @@ -45,7 +45,6 @@ return array ( 'id' => '001', 'countryCode' => 883, 'internationalPrefix' => '', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_888 b/data/PhoneNumberMetadata_888 index 7ae39e0..9554b14 100644 --- a/data/PhoneNumberMetadata_888 +++ b/data/PhoneNumberMetadata_888 @@ -45,7 +45,6 @@ return array ( 'id' => '001', 'countryCode' => 888, 'internationalPrefix' => '', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_979 b/data/PhoneNumberMetadata_979 index 8c812ff..56cf717 100644 --- a/data/PhoneNumberMetadata_979 +++ b/data/PhoneNumberMetadata_979 @@ -45,7 +45,6 @@ return array ( 'id' => '001', 'countryCode' => 979, 'internationalPrefix' => '', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_AC b/data/PhoneNumberMetadata_AC index 447523c..81582c7 100644 --- a/data/PhoneNumberMetadata_AC +++ b/data/PhoneNumberMetadata_AC @@ -2,7 +2,7 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[2-46]\\d{3}', + 'NationalNumberPattern' => '[2-467]\\d{3}', 'PossibleNumberPattern' => '\\d{4}', 'ExampleNumber' => '', ), @@ -12,7 +12,8 @@ return array ( (?: 3[0-5]| 4[4-6]| - [26]\\d + [26]\\d| + 70 )\\d{2} ', 'PossibleNumberPattern' => '\\d{4}', @@ -51,7 +52,6 @@ return array ( 'id' => 'AC', 'countryCode' => 247, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_AD b/data/PhoneNumberMetadata_AD index ee2ddc6..a68e9ad 100644 --- a/data/PhoneNumberMetadata_AD +++ b/data/PhoneNumberMetadata_AD @@ -50,7 +50,6 @@ return array ( 'id' => 'AD', 'countryCode' => 376, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_AE b/data/PhoneNumberMetadata_AE index 37ab9bd..07083ef 100644 --- a/data/PhoneNumberMetadata_AE +++ b/data/PhoneNumberMetadata_AE @@ -56,7 +56,6 @@ return array ( 'id' => 'AE', 'countryCode' => 971, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_AF b/data/PhoneNumberMetadata_AF index 5f05ead..7d3d286 100644 --- a/data/PhoneNumberMetadata_AF +++ b/data/PhoneNumberMetadata_AF @@ -51,7 +51,6 @@ return array ( 'id' => 'AF', 'countryCode' => 93, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_AG b/data/PhoneNumberMetadata_AG index 0a8b23b..356d24b 100644 --- a/data/PhoneNumberMetadata_AG +++ b/data/PhoneNumberMetadata_AG @@ -71,7 +71,6 @@ return array ( 'id' => 'AG', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_AI b/data/PhoneNumberMetadata_AI index bae9e19..d64c800 100644 --- a/data/PhoneNumberMetadata_AI +++ b/data/PhoneNumberMetadata_AI @@ -71,7 +71,6 @@ return array ( 'id' => 'AI', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_AL b/data/PhoneNumberMetadata_AL index 01fe133..7a2cb0a 100644 --- a/data/PhoneNumberMetadata_AL +++ b/data/PhoneNumberMetadata_AL @@ -76,7 +76,6 @@ return array ( 'id' => 'AL', 'countryCode' => 355, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_AM b/data/PhoneNumberMetadata_AM index 093b37b..6b1ff3f 100644 --- a/data/PhoneNumberMetadata_AM +++ b/data/PhoneNumberMetadata_AM @@ -2,7 +2,7 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[1-35-9]\\d{7}', + 'NationalNumberPattern' => '[1-9]\\d{7}', 'PossibleNumberPattern' => '\\d{5,8}', 'ExampleNumber' => '', ), @@ -19,7 +19,8 @@ return array ( 6[1-9]| 8[1-7] )| - 3[12]2 + 3[12]2| + 47\\d )\\d{5} ', 'PossibleNumberPattern' => '\\d{5,8}', @@ -64,7 +65,6 @@ return array ( 'id' => 'AM', 'countryCode' => 374, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -76,7 +76,10 @@ return array ( 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( - 0 => '1', + 0 => ' + 1| + 47 + ', ), 'nationalPrefixFormattingRule' => '(0$1)', 'domesticCarrierCodeFormattingRule' => '', diff --git a/data/PhoneNumberMetadata_AN b/data/PhoneNumberMetadata_AN index c3e3ee0..7f3cb4a 100644 --- a/data/PhoneNumberMetadata_AN +++ b/data/PhoneNumberMetadata_AN @@ -57,7 +57,6 @@ return array ( 'id' => 'AN', 'countryCode' => 599, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_AO b/data/PhoneNumberMetadata_AO index 7b4da43..6bed950 100644 --- a/data/PhoneNumberMetadata_AO +++ b/data/PhoneNumberMetadata_AO @@ -19,7 +19,7 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => '9[1-3]\\d{7}', + 'NationalNumberPattern' => '9[1-4]\\d{7}', 'PossibleNumberPattern' => '\\d{9}', 'ExampleNumber' => '923123456', ), @@ -50,7 +50,6 @@ return array ( 'id' => 'AO', 'countryCode' => 244, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_AR b/data/PhoneNumberMetadata_AR index d26849e..c43f8bc 100644 --- a/data/PhoneNumberMetadata_AR +++ b/data/PhoneNumberMetadata_AR @@ -32,10 +32,14 @@ return array ( 5[2-8]| [067]\\d )| - 47[3-8]| + 4(?: + 7[3-8]| + 9\\d + )| 6(?: - [013-6]\\d| - 2[2-7] + [01346]\\d| + 2[24-6]| + 5[15-8] )| 80\\d| 9(?: @@ -48,6 +52,7 @@ return array ( 3(?: 3(?: 2[79]| + 6\\d| 8[2578] )| 4(?: @@ -66,13 +71,15 @@ return array ( )| 6[24]\\d| 7(?: - [124689]\\d| - 3[1245]| + [01469]\\d| + 2[013-9]| + 3[145]| 5[14-8]| - 7[2-57] + 7[2-57]| + 8[0-24-9] )| 8(?: - [123578]\\d| + [0-3578]\\d| 4[13-6]| 6[1-357-9]| 9[124] @@ -93,17 +100,19 @@ return array ( (?: 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9[147-9] )| 3(?: - 4[1235]| + 36| + 4[12358]| 5[138]| 6[24]| - 7[69]| - 8[1578] + 7[069]| + 8[013578] ) )[2-9]\\d{6}| \\d{4}[2-9]\\d{5} @@ -139,9 +148,8 @@ return array ( 'id' => 'AR', 'countryCode' => 54, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => ' 0(?: (11| 2(?: 2(?: 02?| [13]| 2[13-79]| 4[1-6]| 5[2457]| 6[124-8]| 7[1-4]| 8[13-6]| 9[1-367] )| 3(?: [06]2| 1[467]| 2[02-6]| 3[13-8]| [49][2-6]| 5[2-8]| 7 )| 47[3-578]| 6(?: [0136]| 2[2-7]| 4[6-8]?| 5[15-8] )| 80| 9(?: 0[1-3]| [19]| 2\\d| 3[1-6]| 4[024-68]?| 5[2-4]| 6[2-46]| 72?| 8[23]? ) )| 3(?: 3(?: 2[79]| 8[2578] )| 4(?: 0[124-9]| [12]| 3[5-8]?| 4[24-7]| 5[4-68]?| 6\\d| 7[126]| 8[237-9]| 9[1-36-8] )| 5(?: 1| 2[1245]| 3[2-47]?| 4[1-46-9]| 6[2-4]| 7[1-6]| 8[2-5]? )| 6[24]| 7(?: 1[15-8]| 2[125]| 3[1245]| 4[13]| 5[14-8]| [69]| 7[2-57]| 8[1-36] )| 8(?: 1| 2[125-7]| 3[23578]| 4[13-6]| 5[4-8]?| 6[1-357-9]| 7[36-8]?| 8[5-8]?| 9[124] ) ) )15 )?', + 'nationalPrefixForParsing' => ' 0(?: (11| 2(?: 2(?: 02?| [13]| 2[13-79]| 4[1-6]| 5[2457]| 6[124-8]| 7[1-4]| 8[13-6]| 9[1-367] )| 3(?: [06]2?| 1[467]| 2[02-6]| 3[13-8]| [49][2-6]| 5[2-8]| 7 )| 4(?: 7[3-578]| 9 )| 6(?: [0136]| 2[24-6]| 4[6-8]?| 5[15-8] )| 80| 9(?: 0[1-3]| [19]| 2\\d| 3[1-6]| 4[02568]?| 5[2-4]| 6[2-46]| 72?| 8[23]? ) )| 3(?: 3(?: 2[79]| 6| 8[2578] )| 4(?: 0[124-9]| [12]| 3[5-8]?| 4[24-7]| 5[4-68]?| 6\\d| 7[126]| 8[237-9]?| 9[1-36-8] )| 5(?: 1| 2[1245]| 3[237]?| 4[1-46-9]| 6[2-4]| 7[1-6]| 8[2-5]? )| 6[24]| 7(?: 1[15-8]| 2[15]| 3[145]| 4[13]| 5[14-8]| [069]| 7[2-57]| 8[126] )| 8(?: [01]| 2[125-7]| 3[23578]?| 4[13-6]| 5[4-8]?| 6[1-357-9]| 7[36-8]?| 8[5-8]?| 9[124] ) ) )15 )?', 'nationalPrefixTransformRule' => '9$1', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => @@ -176,25 +184,27 @@ return array ( array ( 0 => ' 9(?: - 2[23689]| - 3[4-8] + 2[234689]| + 3[3-8] ) ', 1 => ' 9(?: 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9[147-9] )| 3(?: - 4[1235]| + 36| + 4[12358]| 5[138]| 6[24]| - 7[69]| - 8[1578] + 7[069]| + 8[013578] ) ) ', @@ -202,24 +212,27 @@ return array ( 9(?: 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9(?: [17-9]| - 4[1379] + 4[13479] ) )| 3(?: - 4[1235]| + 36| + 4[12358]| 5(?: [18]| - 3[0-35689] + 3[0-689] )| 6[24]| - 7[69]| + 7[069]| 8(?: - [15]| + [015]| + 3[0-2479]| 7[0-24-9]| 8[0-79] ) @@ -291,40 +304,45 @@ return array ( 0 => ' 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9[147-9] )| 3(?: - 4[1235]| + 36| + 4[12358]| 5[138]| 6[24]| - 7[69]| - 8[1578] + 7[069]| + 8[013578] ) ', 1 => ' 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9(?: [17-9]| - 4[1379] + 4[13479] ) )| 3(?: - 4[1235]| + 36| + 4[12358]| 5(?: [18]| - 3[0-35689] + 3[0-689] )| 6[24]| - 7[69]| + 7[069]| 8(?: - [15]| + [015]| + 3[0-2479]| 7[0-24-9]| 8[0-79] ) @@ -399,25 +417,27 @@ return array ( array ( 0 => ' 9(?: - 2[23689]| - 3[4-8] + 2[234689]| + 3[3-8] ) ', 1 => ' 9(?: 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9[147-9] )| 3(?: - 4[1235]| + 36| + 4[12358]| 5[138]| 6[24]| - 7[69]| - 8[1578] + 7[069]| + 8[013578] ) ) ', @@ -425,24 +445,27 @@ return array ( 9(?: 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9(?: [17-9]| - 4[1379] + 4[13479] ) )| 3(?: - 4[1235]| + 36| + 4[12358]| 5(?: [18]| - 3[0-35689] + 3[0-689] )| 6[24]| - 7[69]| + 7[069]| 8(?: - [15]| + [015]| + 3[0-2479]| 7[0-24-9]| 8[0-79] ) @@ -506,40 +529,45 @@ return array ( 0 => ' 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9[147-9] )| 3(?: - 4[1235]| + 36| + 4[12358]| 5[138]| 6[24]| - 7[69]| - 8[1578] + 7[069]| + 8[013578] ) ', 1 => ' 2(?: 2[013]| - 37| + 3[067]| + 49| 6[01346]| 80| 9(?: [17-9]| - 4[1379] + 4[13479] ) )| 3(?: - 4[1235]| + 36| + 4[12358]| 5(?: [18]| - 3[0-35689] + 3[0-689] )| 6[24]| - 7[69]| + 7[069]| 8(?: - [15]| + [015]| + 3[0-2479]| 7[0-24-9]| 8[0-79] ) diff --git a/data/PhoneNumberMetadata_AS b/data/PhoneNumberMetadata_AS index 6bbd326..f61ec51 100644 --- a/data/PhoneNumberMetadata_AS +++ b/data/PhoneNumberMetadata_AS @@ -68,7 +68,6 @@ return array ( 'id' => 'AS', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_AT b/data/PhoneNumberMetadata_AT index ad20e00..eba20be 100644 --- a/data/PhoneNumberMetadata_AT +++ b/data/PhoneNumberMetadata_AT @@ -13,7 +13,7 @@ return array ( (?: 2(?: 1[467]| - 2[134-8]| + 2[13-8]| 5[2357]| 6[1-46-8]| 7[1-8]| @@ -117,7 +117,6 @@ return array ( 'id' => 'AT', 'countryCode' => 43, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_AW b/data/PhoneNumberMetadata_AW index 4bfebe8..d9c7024 100644 --- a/data/PhoneNumberMetadata_AW +++ b/data/PhoneNumberMetadata_AW @@ -67,7 +67,6 @@ return array ( 'id' => 'AW', 'countryCode' => 297, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_AX b/data/PhoneNumberMetadata_AX index 09a51a6..71b0b1c 100644 --- a/data/PhoneNumberMetadata_AX +++ b/data/PhoneNumberMetadata_AX @@ -72,7 +72,6 @@ return array ( 'id' => 'AX', 'countryCode' => 358, 'internationalPrefix' => '00|99[049]', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_AZ b/data/PhoneNumberMetadata_AZ index 7a32d9e..b522792 100644 --- a/data/PhoneNumberMetadata_AZ +++ b/data/PhoneNumberMetadata_AZ @@ -2,72 +2,36 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[1-9]\\d{7,8}', - 'PossibleNumberPattern' => '\\d{5,9}', + 'NationalNumberPattern' => '[1-9]\\d{8}', + 'PossibleNumberPattern' => '\\d{7,9}', 'ExampleNumber' => '', ), 'fixedLine' => array ( 'NationalNumberPattern' => ' (?: - 1(?: - (?: - [28]\\d| - 9 - )\\d| - 02| - 1[0-589]| - 3[358]| - 4[013-79]| - 5[0-479]| - 6[02346-9]| - 7[0-24-8] - )| + 1[28]\\d| 2(?: - 02\\d| - 1(?: - 2[0-8]| - 42| - 6 - )| - 2(?: - 2[0-79]| - 3[0-35]| - 42| - [1-35-9]| - )| - 3(?: - 3[0-58]| - [0-24] - )| - 4(?: - 2[0124579]| - [1468] - )| - 5(?: - 2[0124579]| - 5 - )| - 6(?: - 2\\d| - 3[0128]| - [56] - )| - 79 + 02| + 1[24]| + 2[2-4]| + 33| + [45]2| + 6[23] )| - 365?\\d| - 44\\d{2} - )\\d{5} + 365 + )\\d{6} ', - 'PossibleNumberPattern' => '\\d{5,9}', + 'PossibleNumberPattern' => '\\d{7,9}', 'ExampleNumber' => '123123456', ), 'mobile' => array ( 'NationalNumberPattern' => ' (?: - [46]0| + 4[04]| 5[015]| + 60| 7[07] )\\d{7} ', @@ -101,7 +65,6 @@ return array ( 'id' => 'AZ', 'countryCode' => 994, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -128,45 +91,6 @@ return array ( 'domesticCarrierCodeFormattingRule' => '', ), 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '22', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '36[0-46-9]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => ' - 1[013-79]| - 2(?: - [45][13-9]| - [7-9] - ) - ', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - ), - 4 => array ( 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', 'format' => '$1 $2 $3 $4', @@ -177,7 +101,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), - 5 => + 2 => array ( 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', 'format' => '$1 $2 $3 $4', diff --git a/data/PhoneNumberMetadata_BA b/data/PhoneNumberMetadata_BA index dc950a5..4a7092c 100644 --- a/data/PhoneNumberMetadata_BA +++ b/data/PhoneNumberMetadata_BA @@ -50,7 +50,6 @@ return array ( 'id' => 'BA', 'countryCode' => 387, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_BB b/data/PhoneNumberMetadata_BB index 7a884dc..d9b3516 100644 --- a/data/PhoneNumberMetadata_BB +++ b/data/PhoneNumberMetadata_BB @@ -62,7 +62,6 @@ return array ( 'id' => 'BB', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_BE b/data/PhoneNumberMetadata_BE index f625d91..2b367ff 100644 --- a/data/PhoneNumberMetadata_BE +++ b/data/PhoneNumberMetadata_BE @@ -29,9 +29,8 @@ return array ( array ( 'NationalNumberPattern' => ' 4(?: - [67]\\d| - 8[3-9]| - 9[1-9] + [679]\\d| + 8[3-9] )\\d{6} ', 'PossibleNumberPattern' => '\\d{9}', @@ -69,7 +68,6 @@ return array ( 'id' => 'BE', 'countryCode' => 32, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_BF b/data/PhoneNumberMetadata_BF index 5102471..1819ce7 100644 --- a/data/PhoneNumberMetadata_BF +++ b/data/PhoneNumberMetadata_BF @@ -30,11 +30,14 @@ return array ( array ( 'NationalNumberPattern' => ' (?: - 60[0-3]| + 6(?: + 0[0-5]| + [68]0 + )| 7(?: [02-68]\\d| 1[0-4689]| - 7[0-6]| + 7[0-69]| 9[0-689] ) )\\d{5} @@ -69,7 +72,6 @@ return array ( 'id' => 'BF', 'countryCode' => 226, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_BG b/data/PhoneNumberMetadata_BG index 50699f2..53a69c8 100644 --- a/data/PhoneNumberMetadata_BG +++ b/data/PhoneNumberMetadata_BG @@ -78,7 +78,6 @@ return array ( 'id' => 'BG', 'countryCode' => 359, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_BH b/data/PhoneNumberMetadata_BH index b12422d..ad75e48 100644 --- a/data/PhoneNumberMetadata_BH +++ b/data/PhoneNumberMetadata_BH @@ -92,7 +92,6 @@ return array ( 'id' => 'BH', 'countryCode' => 973, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_BI b/data/PhoneNumberMetadata_BI index 7e81873..3427bd2 100644 --- a/data/PhoneNumberMetadata_BI +++ b/data/PhoneNumberMetadata_BI @@ -58,7 +58,6 @@ return array ( 'id' => 'BI', 'countryCode' => 257, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_BJ b/data/PhoneNumberMetadata_BJ index 30bfa8d..c1c3287 100644 --- a/data/PhoneNumberMetadata_BJ +++ b/data/PhoneNumberMetadata_BJ @@ -60,7 +60,6 @@ return array ( 'id' => 'BJ', 'countryCode' => 229, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_BL b/data/PhoneNumberMetadata_BL index 180b39b..40e3d1c 100644 --- a/data/PhoneNumberMetadata_BL +++ b/data/PhoneNumberMetadata_BL @@ -59,7 +59,6 @@ return array ( 'id' => 'BL', 'countryCode' => 590, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_BM b/data/PhoneNumberMetadata_BM index 6c3383a..9cf344c 100644 --- a/data/PhoneNumberMetadata_BM +++ b/data/PhoneNumberMetadata_BM @@ -74,7 +74,6 @@ return array ( 'id' => 'BM', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_BN b/data/PhoneNumberMetadata_BN index a602063..951be84 100644 --- a/data/PhoneNumberMetadata_BN +++ b/data/PhoneNumberMetadata_BN @@ -45,7 +45,6 @@ return array ( 'id' => 'BN', 'countryCode' => 673, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_BO b/data/PhoneNumberMetadata_BO index 49825b5..490cb65 100644 --- a/data/PhoneNumberMetadata_BO +++ b/data/PhoneNumberMetadata_BO @@ -64,7 +64,6 @@ return array ( 'id' => 'BO', 'countryCode' => 591, 'internationalPrefix' => '00(1\\d)?', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0(1\\d)?', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_BQ b/data/PhoneNumberMetadata_BQ index c890d35..4a60417 100644 --- a/data/PhoneNumberMetadata_BQ +++ b/data/PhoneNumberMetadata_BQ @@ -63,7 +63,6 @@ return array ( 'id' => 'BQ', 'countryCode' => 599, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_BR b/data/PhoneNumberMetadata_BR index 7f5d725..9600cc2 100644 --- a/data/PhoneNumberMetadata_BR +++ b/data/PhoneNumberMetadata_BR @@ -2,8 +2,11 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[1-9]\\d{7,9}', - 'PossibleNumberPattern' => '\\d{8,10}', + 'NationalNumberPattern' => ' + [1-46-9]\\d{7,10}| + 5\\d{8,9} + ', + 'PossibleNumberPattern' => '\\d{8,11}', 'ExampleNumber' => '', ), 'fixedLine' => @@ -18,7 +21,7 @@ return array ( 7[13-579] )[2-5]\\d{7} ', - 'PossibleNumberPattern' => '\\d{8,10}', + 'PossibleNumberPattern' => '\\d{8,11}', 'ExampleNumber' => '1123456789', ), 'mobile' => @@ -26,8 +29,9 @@ return array ( 'NationalNumberPattern' => ' 1(?: 1(?: - [6-9]\\d| - 5[347] + 5[347]| + [6-8]\\d| + 9\\d{1,2} )| [2-9][6-9]\\d )\\d{6}| @@ -39,19 +43,19 @@ return array ( 7[13-579] )[6-9]\\d{7} ', - 'PossibleNumberPattern' => '\\d{10}', + 'PossibleNumberPattern' => '\\d{10,11}', 'ExampleNumber' => '1161234567', ), 'tollFree' => array ( 'NationalNumberPattern' => '800\\d{6,7}', - 'PossibleNumberPattern' => '\\d{8,10}', + 'PossibleNumberPattern' => '\\d{8,11}', 'ExampleNumber' => '800123456', ), 'premiumRate' => array ( 'NationalNumberPattern' => '[359]00\\d{6,7}', - 'PossibleNumberPattern' => '\\d{8,10}', + 'PossibleNumberPattern' => '\\d{8,11}', 'ExampleNumber' => '300123456', ), 'sharedCost' => @@ -69,14 +73,24 @@ return array ( 'id' => 'BR', 'countryCode' => 55, 'internationalPrefix' => '00(?:1[45]|2[135]|[34]1|43)', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0(?:(1[245]|2[135]|[34]1)(\\d{10}))?', + 'nationalPrefixForParsing' => '0(?:(1[245]|2[135]|[34]1)(\\d{10,11}))?', 'nationalPrefixTransformRule' => '$2', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( 0 => + array ( + 'pattern' => '(\\d{2})(\\d{5})(\\d{4})', + 'format' => '$1 $2-$3', + 'leadingDigitsPatterns' => + array ( + 0 => '119', + ), + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '0 $CC ($1)', + ), + 1 => array ( 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', 'format' => '$1 $2-$3', @@ -87,7 +101,7 @@ return array ( 'nationalPrefixFormattingRule' => '($1)', 'domesticCarrierCodeFormattingRule' => '0 $CC ($1)', ), - 1 => + 2 => array ( 'pattern' => '([34]00\\d)(\\d{4})', 'format' => '$1-$2', @@ -98,7 +112,7 @@ return array ( 'nationalPrefixFormattingRule' => '', 'domesticCarrierCodeFormattingRule' => '', ), - 2 => + 3 => array ( 'pattern' => '([3589]00)(\\d{2,3})(\\d{4})', 'format' => '$1 $2 $3', diff --git a/data/PhoneNumberMetadata_BS b/data/PhoneNumberMetadata_BS index 6e34f5c..2d0cc59 100644 --- a/data/PhoneNumberMetadata_BS +++ b/data/PhoneNumberMetadata_BS @@ -99,7 +99,6 @@ return array ( 'id' => 'BS', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_BT b/data/PhoneNumberMetadata_BT index 49cbf65..89f140b 100644 --- a/data/PhoneNumberMetadata_BT +++ b/data/PhoneNumberMetadata_BT @@ -54,7 +54,6 @@ return array ( 'id' => 'BT', 'countryCode' => 975, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_BW b/data/PhoneNumberMetadata_BW index fe3b91e..f293ce9 100644 --- a/data/PhoneNumberMetadata_BW +++ b/data/PhoneNumberMetadata_BW @@ -82,7 +82,6 @@ return array ( 'id' => 'BW', 'countryCode' => 267, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_BY b/data/PhoneNumberMetadata_BY index 5a64625..ec4178f 100644 --- a/data/PhoneNumberMetadata_BY +++ b/data/PhoneNumberMetadata_BY @@ -3,7 +3,7 @@ return array ( 'generalDesc' => array ( 'NationalNumberPattern' => ' - [12-4]\\d{8}| + [1-4]\\d{8}| [89]\\d{9,10} ', 'PossibleNumberPattern' => '\\d{7,11}', diff --git a/data/PhoneNumberMetadata_BZ b/data/PhoneNumberMetadata_BZ index 4f75b66..9fb9855 100644 --- a/data/PhoneNumberMetadata_BZ +++ b/data/PhoneNumberMetadata_BZ @@ -17,12 +17,7 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => ' - 6(?: - [0-3]\\d| - [67][01] - )\\d{4} - ', + 'NationalNumberPattern' => '6[0-367]\\d{5}', 'PossibleNumberPattern' => '\\d{7}', 'ExampleNumber' => '6221234', ), @@ -53,7 +48,6 @@ return array ( 'id' => 'BZ', 'countryCode' => 501, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CA b/data/PhoneNumberMetadata_CA index f12b1ed..693ebb6 100644 --- a/data/PhoneNumberMetadata_CA +++ b/data/PhoneNumberMetadata_CA @@ -26,7 +26,7 @@ return array ( 4(?: 03| 1[68]| - 38| + 3[18]| 5[06] )| 5(?: @@ -48,6 +48,7 @@ return array ( 8(?: [06]7| 19| + 73 )| 90[25] )[2-9]\\d{6}| @@ -73,7 +74,7 @@ return array ( 4(?: 03| 1[68]| - 38| + 3[18]| 5[06] )| 5(?: @@ -95,6 +96,7 @@ return array ( 8(?: [06]7| 19| + 73 )| 90[25] )[2-9]\\d{6} @@ -138,7 +140,6 @@ return array ( 'id' => 'CA', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_CD b/data/PhoneNumberMetadata_CD index 536bdd5..c8aba77 100644 --- a/data/PhoneNumberMetadata_CD +++ b/data/PhoneNumberMetadata_CD @@ -3,8 +3,9 @@ return array ( 'generalDesc' => array ( 'NationalNumberPattern' => ' - [89]\\d{8}| - [1-6]\\d{6} + [1-6]\\d{6}| + 8\\d{6,8}| + 9\\d{8} ', 'PossibleNumberPattern' => '\\d{7,9}', 'ExampleNumber' => '', @@ -18,12 +19,13 @@ return array ( 'mobile' => array ( 'NationalNumberPattern' => ' - (?: - 8[0-2489]| - 9[7-9] - )\\d{7} + 8(?: + [0-259]\\d{2}| + [48] + )\\d{5}| + 9[7-9]\\d{7} ', - 'PossibleNumberPattern' => '\\d{9}', + 'PossibleNumberPattern' => '\\d{7,9}', 'ExampleNumber' => '991234567', ), 'tollFree' => @@ -53,7 +55,6 @@ return array ( 'id' => 'CD', 'countryCode' => 243, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -65,14 +66,28 @@ return array ( 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( - 0 => '[89]', + 0 => ' + 8[0-259]| + 9 + ', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), 1 => array ( - 'pattern' => '([1-6]\\d)(\\d{5})', + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => + array ( + 0 => '8[48]', + ), + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + ), + 2 => + array ( + 'pattern' => '(\\d{2})(\\d{5})', 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( diff --git a/data/PhoneNumberMetadata_CF b/data/PhoneNumberMetadata_CF index 92d6991..c4b3f0c 100644 --- a/data/PhoneNumberMetadata_CF +++ b/data/PhoneNumberMetadata_CF @@ -45,7 +45,6 @@ return array ( 'id' => 'CF', 'countryCode' => 236, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CG b/data/PhoneNumberMetadata_CG index 8c9fa0c..27d4272 100644 --- a/data/PhoneNumberMetadata_CG +++ b/data/PhoneNumberMetadata_CG @@ -45,7 +45,6 @@ return array ( 'id' => 'CG', 'countryCode' => 242, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CH b/data/PhoneNumberMetadata_CH index d4429f3..a52cb04 100644 --- a/data/PhoneNumberMetadata_CH +++ b/data/PhoneNumberMetadata_CH @@ -57,7 +57,6 @@ return array ( 'id' => 'CH', 'countryCode' => 41, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_CI b/data/PhoneNumberMetadata_CI index 577b624..29717dd 100644 --- a/data/PhoneNumberMetadata_CI +++ b/data/PhoneNumberMetadata_CI @@ -33,7 +33,7 @@ return array ( 'NationalNumberPattern' => ' (?: 0[1-9]| - 4[04-9]| + 4[0-24-9]| 5[057-9]| 6[05679] )\\d{6} @@ -68,7 +68,6 @@ return array ( 'id' => 'CI', 'countryCode' => 225, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CK b/data/PhoneNumberMetadata_CK index 63b579f..dd38530 100644 --- a/data/PhoneNumberMetadata_CK +++ b/data/PhoneNumberMetadata_CK @@ -56,7 +56,6 @@ return array ( 'id' => 'CK', 'countryCode' => 682, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CL b/data/PhoneNumberMetadata_CL index 25d8909..132853d 100644 --- a/data/PhoneNumberMetadata_CL +++ b/data/PhoneNumberMetadata_CL @@ -67,7 +67,6 @@ return array ( 'id' => 'CL', 'countryCode' => 56, 'internationalPrefix' => '(?:0|1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))0', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0|(1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_CM b/data/PhoneNumberMetadata_CM index 6158852..9e4eedc 100644 --- a/data/PhoneNumberMetadata_CM +++ b/data/PhoneNumberMetadata_CM @@ -50,7 +50,6 @@ return array ( 'id' => 'CM', 'countryCode' => 237, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CN b/data/PhoneNumberMetadata_CN index 1df2707..6e79fdf 100644 --- a/data/PhoneNumberMetadata_CN +++ b/data/PhoneNumberMetadata_CN @@ -158,7 +158,6 @@ return array ( 'id' => 'CN', 'countryCode' => 86, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_CO b/data/PhoneNumberMetadata_CO index b1ab1da..831d0bd 100644 --- a/data/PhoneNumberMetadata_CO +++ b/data/PhoneNumberMetadata_CO @@ -61,7 +61,6 @@ return array ( 'id' => 'CO', 'countryCode' => 57, 'internationalPrefix' => '00[579]|#555|#999', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0([3579]|4(?:44|56))?', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_CR b/data/PhoneNumberMetadata_CR index 14f9a3d..e0bf8d3 100644 --- a/data/PhoneNumberMetadata_CR +++ b/data/PhoneNumberMetadata_CR @@ -52,8 +52,7 @@ return array ( 'id' => 'CR', 'countryCode' => 506, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', - 'nationalPrefixForParsing' => '(19(?:0[0-2]|19|77))', + 'nationalPrefixForParsing' => '(19(?:0[0-2468]|19|66|77))', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CU b/data/PhoneNumberMetadata_CU index bd3078a..f459cf0 100644 --- a/data/PhoneNumberMetadata_CU +++ b/data/PhoneNumberMetadata_CU @@ -12,11 +12,13 @@ return array ( 2[1-4]\\d{5,6}| 3(?: 1\\d{6}| - [23]\\d{4,6})| + [23]\\d{4,6} + )| 4(?: [125]\\d{5,6}| [36]\\d{6}| - [78]\\d{4,6})| + [78]\\d{4,6} + )| 7\\d{6,7} ', 'PossibleNumberPattern' => '\\d{4,8}', @@ -55,7 +57,6 @@ return array ( 'id' => 'CU', 'countryCode' => 53, 'internationalPrefix' => '119', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_CV b/data/PhoneNumberMetadata_CV index 8c02867..37b4f4c 100644 --- a/data/PhoneNumberMetadata_CV +++ b/data/PhoneNumberMetadata_CV @@ -60,7 +60,6 @@ return array ( 'id' => 'CV', 'countryCode' => 238, 'internationalPrefix' => '0', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CW b/data/PhoneNumberMetadata_CW index e0561cf..dc57140 100644 --- a/data/PhoneNumberMetadata_CW +++ b/data/PhoneNumberMetadata_CW @@ -72,7 +72,6 @@ return array ( 'id' => 'CW', 'countryCode' => 599, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CY b/data/PhoneNumberMetadata_CY index 69ddb8f..c1be92f 100644 --- a/data/PhoneNumberMetadata_CY +++ b/data/PhoneNumberMetadata_CY @@ -45,7 +45,6 @@ return array ( 'id' => 'CY', 'countryCode' => 357, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_CZ b/data/PhoneNumberMetadata_CZ index d75a1cb..30fcbe8 100644 --- a/data/PhoneNumberMetadata_CZ +++ b/data/PhoneNumberMetadata_CZ @@ -65,7 +65,6 @@ return array ( 'id' => 'CZ', 'countryCode' => 420, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_DE b/data/PhoneNumberMetadata_DE index 123ce39..dcd3b26 100644 --- a/data/PhoneNumberMetadata_DE +++ b/data/PhoneNumberMetadata_DE @@ -93,7 +93,6 @@ return array ( 'id' => 'DE', 'countryCode' => 49, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -282,6 +281,50 @@ return array ( 'domesticCarrierCodeFormattingRule' => '', ), 6 => + array ( + 'pattern' => '(1\\d{2})(\\d{5,11})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => + array ( + 0 => '181', + ), + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + ), + 7 => + array ( + 'pattern' => '(18\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => + array ( + 0 => '18500', + ), + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + ), + 8 => + array ( + 'pattern' => '(18\\d{2})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => + array ( + 0 => '18[68]', + ), + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + ), + 9 => + array ( + 'pattern' => '(18\\d)(\\d{8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => + array ( + 0 => '18[2-579]', + ), + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + ), + 10 => array ( 'pattern' => '(700)(\\d{4})(\\d{4})', 'format' => '$1 $2 $3', diff --git a/data/PhoneNumberMetadata_DJ b/data/PhoneNumberMetadata_DJ index fafb683..23fa1fa 100644 --- a/data/PhoneNumberMetadata_DJ +++ b/data/PhoneNumberMetadata_DJ @@ -2,29 +2,25 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[1-8]\\d{5,7}', - 'PossibleNumberPattern' => '\\d{6,8}', + 'NationalNumberPattern' => '[27]\\d{7}', + 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '', ), 'fixedLine' => array ( 'NationalNumberPattern' => ' - (?: - 1[05]| - [2-5]\\d - )\\d{4}| 2(?: 1[2-5]| 7[45]| )\\d{5} ', - 'PossibleNumberPattern' => '\\d{6,8}', + 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '21360003', ), 'mobile' => array ( - 'NationalNumberPattern' => '(?:77)?[6-8]\\d{5}', - 'PossibleNumberPattern' => '\\d{6,8}', + 'NationalNumberPattern' => '77[6-8]\\d{5}', + 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '77831001', ), 'tollFree' => @@ -54,21 +50,10 @@ return array ( 'id' => 'DJ', 'countryCode' => 253, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - ), - 1 => array ( 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', 'format' => '$1 $2 $3 $4', diff --git a/data/PhoneNumberMetadata_DK b/data/PhoneNumberMetadata_DK index 2bc3cf0..251822e 100644 --- a/data/PhoneNumberMetadata_DK +++ b/data/PhoneNumberMetadata_DK @@ -57,7 +57,6 @@ return array ( 'id' => 'DK', 'countryCode' => 45, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_DM b/data/PhoneNumberMetadata_DM index 6df39ce..9163f27 100644 --- a/data/PhoneNumberMetadata_DM +++ b/data/PhoneNumberMetadata_DM @@ -74,7 +74,6 @@ return array ( 'id' => 'DM', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_DO b/data/PhoneNumberMetadata_DO index f178869..d057997 100644 --- a/data/PhoneNumberMetadata_DO +++ b/data/PhoneNumberMetadata_DO @@ -103,7 +103,6 @@ return array ( 'id' => 'DO', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_DZ b/data/PhoneNumberMetadata_DZ index 2cc8fbd..32c5550 100644 --- a/data/PhoneNumberMetadata_DZ +++ b/data/PhoneNumberMetadata_DZ @@ -64,7 +64,6 @@ return array ( 'id' => 'DZ', 'countryCode' => 213, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_EC b/data/PhoneNumberMetadata_EC index ecf723a..008a3ba 100644 --- a/data/PhoneNumberMetadata_EC +++ b/data/PhoneNumberMetadata_EC @@ -50,7 +50,6 @@ return array ( 'id' => 'EC', 'countryCode' => 593, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_EE b/data/PhoneNumberMetadata_EE index b9923b1..e5ca035 100644 --- a/data/PhoneNumberMetadata_EE +++ b/data/PhoneNumberMetadata_EE @@ -80,13 +80,12 @@ return array ( 'id' => 'EE', 'countryCode' => 372, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( 0 => array ( - 'pattern' => '([34-79]\\d{2})(\\d{4})', + 'pattern' => '([3-79]\\d{2})(\\d{4})', 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( diff --git a/data/PhoneNumberMetadata_EG b/data/PhoneNumberMetadata_EG index 403b453..f0b548a 100644 --- a/data/PhoneNumberMetadata_EG +++ b/data/PhoneNumberMetadata_EG @@ -15,31 +15,36 @@ return array ( array ( 'NationalNumberPattern' => ' (?: - 1[35][23]| - 2[23]\\d| - 3\\d| + 1( + 3[23]\\d| + 5[23] + )| + 2[2-4]\\d{2}| + 3\\d{2}| 4(?: - 0[2-4]| + 0[2-5]| [578][23]| 64 - )| + )\\d| 5(?: - 0[234]| + 0[2-7]| [57][23] - )| - 6[24-689]3| + )\\d| + 6[24-689]3\\d| 8(?: - [28][2-4]| - 42| - 6[23] - )| + 2[2-57]| + 4[26]| + 6[237]| + 8[2-4] + )\\d| 9(?: - [25]2| + 2[27]| 3[24]| - 6[23]| + 52| + 6[2356]| 7[2-4] - ) - )\\d{6}| + )\\d + )\\d{5}| 1[69]\\d{3} ', 'PossibleNumberPattern' => '\\d{5,9}', @@ -49,16 +54,12 @@ return array ( array ( 'NationalNumberPattern' => ' 1(?: - [0-246-9]| - 5[0-2] - )\\d{7}| - 1(?: - 0[0169]| + 0[01269]| 1[124]| - 2[0278] + 2[0-278] )\\d{7} ', - 'PossibleNumberPattern' => '\\d{9,10}', + 'PossibleNumberPattern' => '\\d{10}', 'ExampleNumber' => '1001234567', ), 'tollFree' => @@ -88,7 +89,6 @@ return array ( 'id' => 'EG', 'countryCode' => 20, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -113,9 +113,7 @@ return array ( array ( 0 => ' 1(?: - 0[0169]| - 1[124]| - 2[0278]| + [012]| 5[0-2] )| [89]00 @@ -126,28 +124,15 @@ return array ( ), 2 => array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => ' - 1(?: - [0-246-9]| - 5[3-9] - ) - ', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', + 'pattern' => '(\\d{2})(\\d{6,7})', 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( 0 => ' - 13| + 1(?: + 3| + 5[23] + )| [4-6]| [89][2-9] ', diff --git a/data/PhoneNumberMetadata_ER b/data/PhoneNumberMetadata_ER index c64267c..d05499e 100644 --- a/data/PhoneNumberMetadata_ER +++ b/data/PhoneNumberMetadata_ER @@ -57,7 +57,6 @@ return array ( 'id' => 'ER', 'countryCode' => 291, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_ES b/data/PhoneNumberMetadata_ES index 2cbc94d..bcc49cb 100644 --- a/data/PhoneNumberMetadata_ES +++ b/data/PhoneNumberMetadata_ES @@ -65,7 +65,6 @@ return array ( 'id' => 'ES', 'countryCode' => 34, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_ET b/data/PhoneNumberMetadata_ET index 6ebfd24..88aa5ac 100644 --- a/data/PhoneNumberMetadata_ET +++ b/data/PhoneNumberMetadata_ET @@ -35,7 +35,7 @@ return array ( 4(?: 1[69]| 3[2-49]| - 4[0-23]| + 4[0-3]| 6[5-8] )| 5(?: @@ -160,7 +160,6 @@ return array ( 'id' => 'ET', 'countryCode' => 251, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_FI b/data/PhoneNumberMetadata_FI index 97a8c05..a899077 100644 --- a/data/PhoneNumberMetadata_FI +++ b/data/PhoneNumberMetadata_FI @@ -80,7 +80,6 @@ return array ( 'id' => 'FI', 'countryCode' => 358, 'internationalPrefix' => '00|99[049]', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_FK b/data/PhoneNumberMetadata_FK index 25d14b0..2046ab7 100644 --- a/data/PhoneNumberMetadata_FK +++ b/data/PhoneNumberMetadata_FK @@ -45,7 +45,6 @@ return array ( 'id' => 'FK', 'countryCode' => 500, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_FM b/data/PhoneNumberMetadata_FM index fff4df6..1f2326e 100644 --- a/data/PhoneNumberMetadata_FM +++ b/data/PhoneNumberMetadata_FM @@ -51,7 +51,6 @@ return array ( 'id' => 'FM', 'countryCode' => 691, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_FO b/data/PhoneNumberMetadata_FO index 708fdda..1089d43 100644 --- a/data/PhoneNumberMetadata_FO +++ b/data/PhoneNumberMetadata_FO @@ -63,7 +63,6 @@ return array ( 'id' => 'FO', 'countryCode' => 298, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefixForParsing' => '(10(?:01|[12]0|88))', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => diff --git a/data/PhoneNumberMetadata_GA b/data/PhoneNumberMetadata_GA index bb56887..67ebe63 100644 --- a/data/PhoneNumberMetadata_GA +++ b/data/PhoneNumberMetadata_GA @@ -53,7 +53,7 @@ return array ( 2[89]| 3[35-9]| 4[01]| - 5[0-347-9]| + 5[0-47-9]| [67]\\d| 8[457-9]| 9[0146] @@ -90,7 +90,6 @@ return array ( 'id' => 'GA', 'countryCode' => 241, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_GB b/data/PhoneNumberMetadata_GB index 5ad025b..e86848e 100644 --- a/data/PhoneNumberMetadata_GB +++ b/data/PhoneNumberMetadata_GB @@ -327,7 +327,6 @@ return array ( 'id' => 'GB', 'countryCode' => 44, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'preferredExtnPrefix' => ' x', 'nationalPrefixForParsing' => '0', diff --git a/data/PhoneNumberMetadata_GD b/data/PhoneNumberMetadata_GD index f66a70a..1fefcab 100644 --- a/data/PhoneNumberMetadata_GD +++ b/data/PhoneNumberMetadata_GD @@ -89,7 +89,6 @@ return array ( 'id' => 'GD', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_GF b/data/PhoneNumberMetadata_GF index 9972b51..6332ac5 100644 --- a/data/PhoneNumberMetadata_GF +++ b/data/PhoneNumberMetadata_GF @@ -63,7 +63,6 @@ return array ( 'id' => 'GF', 'countryCode' => 594, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_GG b/data/PhoneNumberMetadata_GG index 217ef36..d9694c2 100644 --- a/data/PhoneNumberMetadata_GG +++ b/data/PhoneNumberMetadata_GG @@ -76,7 +76,6 @@ return array ( 'id' => 'GG', 'countryCode' => 44, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'preferredExtnPrefix' => ' x', 'nationalPrefixForParsing' => '0', diff --git a/data/PhoneNumberMetadata_GH b/data/PhoneNumberMetadata_GH index 9496211..32880bf 100644 --- a/data/PhoneNumberMetadata_GH +++ b/data/PhoneNumberMetadata_GH @@ -2,7 +2,10 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[235]\\d{6,8}', + 'NationalNumberPattern' => ' + [235]\\d{8}| + 8\\d{7} + ', 'PossibleNumberPattern' => '\\d{7,9}', 'ExampleNumber' => '', ), @@ -20,12 +23,13 @@ return array ( 7\\d )| 3(?: - 2[0-37]| + 2[0-3]| 7\\d )| 4(?: - [27]\\d| - 30 + 2[013-9]| + 3[01]| + 7\\d )| 5(?: 2[0-7]| @@ -49,7 +53,7 @@ return array ( 'NationalNumberPattern' => ' (?: 2[034678]| - 5[47] + 5[047] )\\d{7} ', 'PossibleNumberPattern' => '\\d{9}', @@ -57,9 +61,9 @@ return array ( ), 'tollFree' => array ( - 'NationalNumberPattern' => 'NA', - 'PossibleNumberPattern' => 'NA', - 'ExampleNumber' => '', + 'NationalNumberPattern' => '800\\d{5}', + 'PossibleNumberPattern' => '\\d{8}', + 'ExampleNumber' => '80012345', ), 'premiumRate' => array ( @@ -75,14 +79,13 @@ return array ( ), 'noInternationalDialling' => array ( - 'NationalNumberPattern' => 'NA', - 'PossibleNumberPattern' => 'NA', - 'ExampleNumber' => '', + 'NationalNumberPattern' => '800\\d{5}', + 'PossibleNumberPattern' => '\\d{8}', + 'ExampleNumber' => '80012345', ), 'id' => 'GH', 'countryCode' => 233, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -94,6 +97,18 @@ return array ( 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( + 0 => '[235]', + ), + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + ), + 1 => + array ( + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => + array ( + 0 => '8', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', diff --git a/data/PhoneNumberMetadata_GI b/data/PhoneNumberMetadata_GI index 317c7e5..76ef5b8 100644 --- a/data/PhoneNumberMetadata_GI +++ b/data/PhoneNumberMetadata_GI @@ -56,7 +56,6 @@ return array ( 'id' => 'GI', 'countryCode' => 350, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_GL b/data/PhoneNumberMetadata_GL index e91075b..5cf5ed7 100644 --- a/data/PhoneNumberMetadata_GL +++ b/data/PhoneNumberMetadata_GL @@ -53,7 +53,6 @@ return array ( 'id' => 'GL', 'countryCode' => 299, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_GM b/data/PhoneNumberMetadata_GM index d0475fc..6e3e9a9 100644 --- a/data/PhoneNumberMetadata_GM +++ b/data/PhoneNumberMetadata_GM @@ -2,7 +2,7 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[3-9]\\d{6}', + 'NationalNumberPattern' => '[2-9]\\d{6}', 'PossibleNumberPattern' => '\\d{7}', 'ExampleNumber' => '', ), @@ -37,7 +37,12 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => '[3679]\\d{6}', + 'NationalNumberPattern' => ' + (?: + 2[0-2]| + [3679]\\d + )\\d{5} + ', 'PossibleNumberPattern' => '\\d{7}', 'ExampleNumber' => '3012345', ), @@ -68,7 +73,6 @@ return array ( 'id' => 'GM', 'countryCode' => 220, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_GN b/data/PhoneNumberMetadata_GN index 7cf5e19..285870b 100644 --- a/data/PhoneNumberMetadata_GN +++ b/data/PhoneNumberMetadata_GN @@ -2,8 +2,8 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[3567]\\d{7}', - 'PossibleNumberPattern' => '\\d{8}', + 'NationalNumberPattern' => '[23567]\\d{7,8}', + 'PossibleNumberPattern' => '\\d{8,9}', 'ExampleNumber' => '', ), 'fixedLine' => @@ -25,21 +25,25 @@ return array ( 'mobile' => array ( 'NationalNumberPattern' => ' - 55\\d{6}| + (?: + 24| + 55 + )\\d{6}| 6(?: 0(?: 2[0-35-9]| 3[3467]| 5[2457-9] )| - [24578]\\d{2}| + 2\\d{2,3}| + [4-9]\\d{2}| 3(?: [14]0| 35 ) )\\d{4} ', - 'PossibleNumberPattern' => '\\d{8}', + 'PossibleNumberPattern' => '\\d{8,9}', 'ExampleNumber' => '60201234', ), 'tollFree' => @@ -69,7 +73,6 @@ return array ( 'id' => 'GN', 'countryCode' => 224, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( @@ -79,6 +82,18 @@ return array ( 'format' => '$1 $2 $3 $4', 'leadingDigitsPatterns' => array ( + 0 => '[23567]', + ), + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + ), + 1 => + array ( + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => + array ( + 0 => '62', ), 'nationalPrefixFormattingRule' => '', 'domesticCarrierCodeFormattingRule' => '', diff --git a/data/PhoneNumberMetadata_GP b/data/PhoneNumberMetadata_GP index 72c67ff..9c5be20 100644 --- a/data/PhoneNumberMetadata_GP +++ b/data/PhoneNumberMetadata_GP @@ -66,7 +66,6 @@ return array ( 'id' => 'GP', 'countryCode' => 590, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_GQ b/data/PhoneNumberMetadata_GQ index 3acb227..97e29e3 100644 --- a/data/PhoneNumberMetadata_GQ +++ b/data/PhoneNumberMetadata_GQ @@ -58,7 +58,6 @@ return array ( 'id' => 'GQ', 'countryCode' => 240, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_GR b/data/PhoneNumberMetadata_GR index a3ef94f..20d797e 100644 --- a/data/PhoneNumberMetadata_GR +++ b/data/PhoneNumberMetadata_GR @@ -111,7 +111,6 @@ return array ( 'id' => 'GR', 'countryCode' => 30, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_GT b/data/PhoneNumberMetadata_GT index 4e37cf3..2e264dc 100644 --- a/data/PhoneNumberMetadata_GT +++ b/data/PhoneNumberMetadata_GT @@ -48,7 +48,6 @@ return array ( 'id' => 'GT', 'countryCode' => 502, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_GU b/data/PhoneNumberMetadata_GU index 671d6c7..439f576 100644 --- a/data/PhoneNumberMetadata_GU +++ b/data/PhoneNumberMetadata_GU @@ -141,7 +141,6 @@ return array ( 'id' => 'GU', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => true, diff --git a/data/PhoneNumberMetadata_GW b/data/PhoneNumberMetadata_GW index 5c4aa8a..e582a2c 100644 --- a/data/PhoneNumberMetadata_GW +++ b/data/PhoneNumberMetadata_GW @@ -54,7 +54,6 @@ return array ( 'id' => 'GW', 'countryCode' => 245, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_GY b/data/PhoneNumberMetadata_GY index 90165ab..8928125 100644 --- a/data/PhoneNumberMetadata_GY +++ b/data/PhoneNumberMetadata_GY @@ -70,7 +70,6 @@ return array ( 'id' => 'GY', 'countryCode' => 592, 'internationalPrefix' => '001', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_HK b/data/PhoneNumberMetadata_HK index 68e7758..2b897e6 100644 --- a/data/PhoneNumberMetadata_HK +++ b/data/PhoneNumberMetadata_HK @@ -5,20 +5,34 @@ return array ( 'NationalNumberPattern' => ' [235-7]\\d{7}| 8\\d{7,8}| - 9\\d{7,10} + 9\\d{4,10} ', - 'PossibleNumberPattern' => '\\d{8,11}', + 'PossibleNumberPattern' => '\\d{5,11}', 'ExampleNumber' => '', ), 'fixedLine' => array ( - 'NationalNumberPattern' => '[23]\\d{7}', + 'NationalNumberPattern' => ' + (?: + [23]\\d| + 5[78] + )\\d{6} + ', 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '21234567', ), 'mobile' => array ( - 'NationalNumberPattern' => '[5-79]\\d{7}', + 'NationalNumberPattern' => ' + (?: + 5[1-69]\\d| + 6\\d{2}| + 9(?: + 0[1-9]| + [1-8]\\d + ) + )\\d{5} + ', 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '51234567', ), @@ -30,8 +44,13 @@ return array ( ), 'premiumRate' => array ( - 'NationalNumberPattern' => '900\\d{8}', - 'PossibleNumberPattern' => '\\d{11}', + 'NationalNumberPattern' => ' + 900(?: + [0-24-9]\\d{7}| + 3\\d{1,4} + ) + ', + 'PossibleNumberPattern' => '\\d{5,11}', 'ExampleNumber' => '90012345678', ), 'sharedCost' => @@ -49,7 +68,6 @@ return array ( 'id' => 'HK', 'countryCode' => 852, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( @@ -92,6 +110,17 @@ return array ( 'nationalPrefixFormattingRule' => '', 'domesticCarrierCodeFormattingRule' => '', ), + 3 => + array ( + 'pattern' => '(900)(\\d{2,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => + array ( + 0 => '900', + ), + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + ), ), 'intlNumberFormat' => array ( diff --git a/data/PhoneNumberMetadata_HN b/data/PhoneNumberMetadata_HN index 3994e14..631074e 100644 --- a/data/PhoneNumberMetadata_HN +++ b/data/PhoneNumberMetadata_HN @@ -16,7 +16,8 @@ return array ( [23]\\d| 4[056]| 5[57]| - 9[01] + 8[0146-9]| + 9[012] )| 4(?: 2|3-59]| @@ -84,7 +85,6 @@ return array ( 'id' => 'HN', 'countryCode' => 504, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_HR b/data/PhoneNumberMetadata_HR index 070ab6b..12a4aea 100644 --- a/data/PhoneNumberMetadata_HR +++ b/data/PhoneNumberMetadata_HR @@ -59,7 +59,6 @@ return array ( 'id' => 'HR', 'countryCode' => 385, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_HT b/data/PhoneNumberMetadata_HT index 73dd8c4..814b965 100644 --- a/data/PhoneNumberMetadata_HT +++ b/data/PhoneNumberMetadata_HT @@ -56,7 +56,6 @@ return array ( 'id' => 'HT', 'countryCode' => 509, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_HU b/data/PhoneNumberMetadata_HU index 655cee6..f8a0de5 100644 --- a/data/PhoneNumberMetadata_HU +++ b/data/PhoneNumberMetadata_HU @@ -68,7 +68,6 @@ return array ( 'id' => 'HU', 'countryCode' => 36, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '06', 'nationalPrefixForParsing' => '06', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_ID b/data/PhoneNumberMetadata_ID index d10a7dc..d971b8d 100644 --- a/data/PhoneNumberMetadata_ID +++ b/data/PhoneNumberMetadata_ID @@ -9,7 +9,13 @@ return array ( 'fixedLine' => array ( 'NationalNumberPattern' => ' - 2[124]\\d{7,8}| + 2(?: + 1(?: + [0-8]\\d{6,7}| + 9\\d{6} + )| + [24]\\d{7,8} + )| (?: 2(?: [35][1-4]| @@ -47,7 +53,7 @@ return array ( 6[1-8] )| 6(?: - 19? | + 19?| [25]\\d| 3[1-469]| 4[1-6] @@ -62,7 +68,7 @@ return array ( )| 9(?: 0[12]| - 1[0134-8]| + 1[013-8]| 2[0-479]| 5[125-8]| 6[23679]| @@ -76,7 +82,83 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => '8[1-35-9]\\d{7,9}', + 'NationalNumberPattern' => ' + (?: + 2(?: + 1(?: + 3[145]| + 4[01]| + 5[1-469]| + 60| + 8[0359]| + 9\\d + )| + 2(?: + 88| + 9[1256] + )| + 3[1-4]9| + 4(?: + 36| + 91 + )| + 5(?: + 1[349]| + [2-4]9 + )| + 6[0-7]9| + 7(?: + [1-36]9| + 4[39] + )| + 8[1-5]9| + 9[1-48]9 + )| + 3(?: + 19[1-3]| + 2[12]9| + 3[13]9| + 4(?: + 1[69]| + 39 + )| + 5[14]9| + 6(?: + 1[69]| + 2[89] + )| + 709 + )| + 4[13]19| + 5(?: + 1(?: + 19| + 8[39] + )| + 4[129]9| + 6[12]9 + )| + 6(?: + 19[12]| + 2(?: + [23]9| + 77 + ) + )| + 7(?: + 1[13]9| + 2[15]9| + 419| + 5(?: + 1[89]| + 29 + )| + 6[15]9| + 7[178]9 + ) + )\\d{5,6}| + 8[1-35-9]\\d{7,9} + ', 'PossibleNumberPattern' => '\\d{9,11}', 'ExampleNumber' => '812345678', ), @@ -110,7 +192,6 @@ return array ( 'id' => 'ID', 'countryCode' => 62, 'internationalPrefix' => '0(?:0[1789]|10(?:00|1[67]))', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_IE b/data/PhoneNumberMetadata_IE index 9a324f2..b0d4b30 100644 --- a/data/PhoneNumberMetadata_IE +++ b/data/PhoneNumberMetadata_IE @@ -91,7 +91,6 @@ return array ( 'id' => 'IE', 'countryCode' => 353, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_IL b/data/PhoneNumberMetadata_IL index a0d85a9..ae8ceb7 100644 --- a/data/PhoneNumberMetadata_IL +++ b/data/PhoneNumberMetadata_IL @@ -83,7 +83,6 @@ return array ( 'id' => 'IL', 'countryCode' => 972, 'internationalPrefix' => '0(?:0|1[2-48])', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_IM b/data/PhoneNumberMetadata_IM index 7460d4f..b817ca2 100644 --- a/data/PhoneNumberMetadata_IM +++ b/data/PhoneNumberMetadata_IM @@ -58,7 +58,6 @@ return array ( 'id' => 'IM', 'countryCode' => 44, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'preferredExtnPrefix' => ' x', 'nationalPrefixForParsing' => '0', diff --git a/data/PhoneNumberMetadata_IN b/data/PhoneNumberMetadata_IN index bb74c76..66d1b7f 100644 --- a/data/PhoneNumberMetadata_IN +++ b/data/PhoneNumberMetadata_IN @@ -18,8 +18,8 @@ return array ( 33| 4[04]| 79 - )[2-6]\\d{7}| - 80[2-46]\\d{7}| + )[2-7]\\d{7}| + 80[2-467]\\d{7}| (?: 1(?: 2[0-249]| @@ -92,7 +92,7 @@ return array ( 8[34]| 91 ) - )[2-6]\\d{6}| + )[2-7]\\d{6}| (?: (?: 1(?: @@ -149,9 +149,8 @@ return array ( 2[2457]| 3[2-4]| 4[235-7]| - 5[2-689]| + [57][2-689]| 6[24-58]| - 7[23-689]| 8[1-6] )| 8(?: @@ -181,7 +180,7 @@ return array ( [013-8]\\d ) ) - )[2-6]\\d{5} + )[2-7]\\d{5} ', 'PossibleNumberPattern' => '\\d{6,10}', 'ExampleNumber' => '1123456789', @@ -198,21 +197,20 @@ return array ( 9[389] )| 3(?: - 0[13-9]| - 5[0-4789]| + 0[1-9]| + [58]\\d| 7[3679]| - 8[1-9]| 9[689] )| 4(?: - 0[1245789]| + 0[1-9]| 1[15-9]| [29][89]| 39| 8[389] )| 5(?: - 0[0-5789]| + 0\\d| [47]9| [25]0| 6[6-9]| @@ -259,8 +257,8 @@ return array ( 2(?: [2369]\\d| 52| - 7[01357]| - 8[567] + 7[0135789]| + 8[01567] )| 3(?: 0[0235-8]| @@ -274,39 +272,40 @@ return array ( 6[09] )| 5(?: - 0[079]| - 11| - 2\\d| + 0[07-9]| + 1[01]| + [26]\\d| 30| 4[47]| - 53| + 5[39]| 7[45]| - 85| - 9[015] + 8[56]| + 9[0157] )| 6(?: [0589]\\d| - 7[09] + 49| + 7[0-59] )| 7(?: 1[24]| 33| + 49| [2569]\\d )| 8(?: [07-9]\\d| - 17| + 1[057]| 2[024-8]| 44| 5[3589]| 6[0167] )| 9(?: - [057-9]\\d| + [05-9]\\d| 2[35-9]| 3[019]| - 4[036-8]| - 6[0-46-9] + 4[036-8] ) )| 9\\d{3} @@ -364,7 +363,6 @@ return array ( 'id' => 'IN', 'countryCode' => 91, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -392,9 +390,9 @@ return array ( 2[236-9]| 3[0479]| 4[0-68]| - 5[0-57-9] - 6[05789] - 7[123569]| + 5| + 6[045789]| + 7[1-69]| 8[0124-9]| 9[02-9] )| @@ -409,21 +407,20 @@ return array ( 9[389] )| 3(?: - 0[13-9]| - 5[0-4789]| + 0[1-9]| + [58]| 7[3679]| - 8[1-9]| 9[689] )| 4(?: - 0[1245789]| + 0[1-9]| 1[15-9]| [29][89]| 39| 8[389] )| 5(?: - 0[0-5789]| + 0| [47]9| [25]0| 6[6-9]| @@ -467,8 +464,8 @@ return array ( )| 2(?: [2369]| - 7[01357]| - 8[567] + 7[0135789]| + 8[01567] )| 3(?: 0[0235-8]| @@ -482,39 +479,40 @@ return array ( 6[09] )| 5(?: - 0[079]| - 11| - 2| + 0[07-9]| + 1[01]| + [26]| 30| 4[47]| - 53| - 85| + 5[39]| + 8[56]| 7[45]| - 9[015] + 9[0157] )| 6(?: [0589]| - 70 + 49| + 7[0-5] )| 7(?: 1[24]| 33| + 49| [2569] )| 8(?: [07-9]| - 17| + 1[057]| 2[024-8]| 44| 5[3589]| 6[0167] )| 9(?: - [057-9]| + [05-9]| 2[35-9]| 3[019]| - 4[03678]| - 6[0-46-9] + 4[03678] ) )| 9 diff --git a/data/PhoneNumberMetadata_IO b/data/PhoneNumberMetadata_IO index a7e8e9f..0496fa2 100644 --- a/data/PhoneNumberMetadata_IO +++ b/data/PhoneNumberMetadata_IO @@ -45,7 +45,6 @@ return array ( 'id' => 'IO', 'countryCode' => 246, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_IQ b/data/PhoneNumberMetadata_IQ index a1c6854..fc4d50e 100644 --- a/data/PhoneNumberMetadata_IQ +++ b/data/PhoneNumberMetadata_IQ @@ -54,7 +54,6 @@ return array ( 'id' => 'IQ', 'countryCode' => 964, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_IR b/data/PhoneNumberMetadata_IR index 9f43fce..8e749a6 100644 --- a/data/PhoneNumberMetadata_IR +++ b/data/PhoneNumberMetadata_IR @@ -5,7 +5,7 @@ return array ( 'NationalNumberPattern' => ' [2-6]\\d{4,9}| 9(?: - [134]\\d{8}| + [1-4]\\d{8}| 9\\d{2,8} )| [178]\\d{9} @@ -46,9 +46,10 @@ return array ( )| 2(?: 2[189]| - [3689][12]| + [389][12]| 42| 5[256]| + 6[1-59]| 7[34] )| 3(?: @@ -100,9 +101,22 @@ return array ( array ( 'NationalNumberPattern' => ' 9(?: - 1\\d| - 3[124-9] - )\\d{7} + 1(?: + [039]\\d| + [16][1-35-9]| + 2[1-8]| + 4[013-9]| + [57][1-9]| + 8[13-9] + )| + 2[01]\\d| + 3(?: + [035-9]\\d| + 13| + 2[1-579]| + 47 + ) + )\\d{6} ', 'PossibleNumberPattern' => '\\d{10}', 'ExampleNumber' => '9123456789', @@ -134,7 +148,6 @@ return array ( 'id' => 'IR', 'countryCode' => 98, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_IS b/data/PhoneNumberMetadata_IS index f653b71..9b17ab3 100644 --- a/data/PhoneNumberMetadata_IS +++ b/data/PhoneNumberMetadata_IS @@ -93,7 +93,6 @@ return array ( 'id' => 'IS', 'countryCode' => 354, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_IT b/data/PhoneNumberMetadata_IT index b4e246d..b92fdbb 100644 --- a/data/PhoneNumberMetadata_IT +++ b/data/PhoneNumberMetadata_IT @@ -73,14 +73,13 @@ return array ( ), 'noInternationalDialling' => array ( - 'NationalNumberPattern' => 'NA', - 'PossibleNumberPattern' => 'NA', - 'ExampleNumber' => '', + 'NationalNumberPattern' => '848\\d{6,7}', + 'PossibleNumberPattern' => '\\d{9,10}', + 'ExampleNumber' => '8481234567', ), 'id' => 'IT', 'countryCode' => 39, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_JE b/data/PhoneNumberMetadata_JE index e1d71a4..9ff12a7 100644 --- a/data/PhoneNumberMetadata_JE +++ b/data/PhoneNumberMetadata_JE @@ -93,7 +93,6 @@ return array ( 'id' => 'JE', 'countryCode' => 44, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'preferredExtnPrefix' => ' x', 'nationalPrefixForParsing' => '0', diff --git a/data/PhoneNumberMetadata_JM b/data/PhoneNumberMetadata_JM index 9c21e4a..059ba22 100644 --- a/data/PhoneNumberMetadata_JM +++ b/data/PhoneNumberMetadata_JM @@ -106,7 +106,6 @@ return array ( 'id' => 'JM', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_JO b/data/PhoneNumberMetadata_JO index c48691c..abdd27c 100644 --- a/data/PhoneNumberMetadata_JO +++ b/data/PhoneNumberMetadata_JO @@ -10,12 +10,72 @@ return array ( array ( 'NationalNumberPattern' => ' (?: - 2[67]| - 32| - 53| - 6[2-5]| - 87 - )\\d{6} + 2(?: + 6(?: + 2[0-35-9]| + 3[0-57-8]| + 4[24-7]| + 5[0-24-8]| + [6-9][02] + )| + 7(?: + 0[1-79]| + 10| + 2[014-7]| + 3[0-689]| + 4[019]| + 5[0-3578] + ) + )| + 32(?: + 0[1-69]| + 1[1-35-7]| + 2[024-7]| + 3\\d| + [457][02]| + 60 + )| + 53(?: + [013][02]| + 2[0-59]| + 49| + 5[0-35-9]| + 6[15]| + 7[45]| + 8[1-6]| + 9[0-36-9] + )| + 6(?: + 2[50]0| + 300| + 4(?: + 0[0125]| + 1[2-7]| + 2[0569]| + [38][07-9]| + 4[025689]| + 6[0-589]| + 7\\d| + 9[0-2] + )| + 5(?: + [01][056]| + 2[034]| + 3[0-57-9]| + 4[17-8]| + 5[0-69]| + 6[0-35-9]| + 7[1-379]| + 8[0-68]| + 9[02-39] + )| + )| + 87(?: + [02]0| + 7[08]| + 9[09] + ) + )\\d{4} ', 'PossibleNumberPattern' => '\\d{7,8}', 'ExampleNumber' => '62001234', @@ -61,7 +121,6 @@ return array ( 'id' => 'JO', 'countryCode' => 962, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_JP b/data/PhoneNumberMetadata_JP index 551aafc..cf28edc 100644 --- a/data/PhoneNumberMetadata_JP +++ b/data/PhoneNumberMetadata_JP @@ -119,7 +119,6 @@ return array ( 'id' => 'JP', 'countryCode' => 81, 'internationalPrefix' => '010', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -358,7 +357,7 @@ return array ( 9[1-578] )| 2(?: - 2[034-9]| + 2[03-9]| 3[3-58]| 4[0-468]| 5[04-8]| @@ -405,7 +404,7 @@ return array ( 9(?: [23]0| 4[02-46-9]| - 5[0245-79]| + 5[024-79]| 6[4-9]| 7[2-47-9]| 8[02-7]| @@ -500,7 +499,7 @@ return array ( 9[2-8] )| 3(?: - 7[2-56]| + 7[2-6]| [3-6][2-9]| 8[2-5] )| @@ -520,7 +519,7 @@ return array ( 9(?: [23]0| 4[02-46-9]| - 5[0245-79]| + 5[024-79]| 6[4-9]| 7[2-47-9]| 8[02-7]| @@ -655,7 +654,7 @@ return array ( 9(?: [23]0| 4[02-46-9]| - 5[0245-79]| + 5[024-79]| 6[4-9]| 7[2-47-9]| 8[02-7]| @@ -797,7 +796,7 @@ return array ( 9(?: [23]0| 4[02-46-9]| - 5[0245-79]| + 5[024-79]| 6[4-9]| 7[2-47-9]| 8[02-7]| @@ -825,7 +824,7 @@ return array ( 1| 2(?: 23| - 5[5-89]| + 5[5-9]| 64| 78| 8[39]| diff --git a/data/PhoneNumberMetadata_KE b/data/PhoneNumberMetadata_KE index 65c4c1d..e6fdabd 100644 --- a/data/PhoneNumberMetadata_KE +++ b/data/PhoneNumberMetadata_KE @@ -3,34 +3,42 @@ return array ( 'generalDesc' => array ( 'NationalNumberPattern' => ' - 20\\d{4,7}| - [4-9]\\d{5,9} + 20\\d{6,7}| + [4-9]\\d{6,9} ', - 'PossibleNumberPattern' => '\\d{4,10}', + 'PossibleNumberPattern' => '\\d{5,10}', 'ExampleNumber' => '', ), 'fixedLine' => array ( 'NationalNumberPattern' => ' - (?: - 20| - 4[0-6]| - 5\\d| - 6[0-24-9] - )\\d{4,7} + 20\\d{6,7}| + 4(?: + [013]\\d{7}| + [24-6]\\d{5,7} + )| + 5(?: + [0-36-8]\\d{5,7}| + [459]\\d{5} + )| + 6(?: + [08]\\d{5}| + [14-79]\\d{5,7}| + 2\\d{7} + ) ', - 'PossibleNumberPattern' => '\\d{4,9}', + 'PossibleNumberPattern' => '\\d{5,9}', 'ExampleNumber' => '202012345', ), 'mobile' => array ( 'NationalNumberPattern' => ' 7(?: - 0[0-5]| + 0[0-8]| [123]\\d| - 5[0-4]| + 5[0-5]| 7[0-5]| - 8[6-9] + 8[5-9] )\\d{6} ', 'PossibleNumberPattern' => '\\d{9}', @@ -38,18 +46,13 @@ return array ( ), 'tollFree' => array ( - 'NationalNumberPattern' => '800[245-8]\\d{5,6}', + 'NationalNumberPattern' => '800[24-8]\\d{5,6}', 'PossibleNumberPattern' => '\\d{9,10}', 'ExampleNumber' => '800223456', ), 'premiumRate' => array ( - 'NationalNumberPattern' => ' - 9(?: - 00[2-578]| - 11\\d - )\\d{5} - ', + 'NationalNumberPattern' => '900[02-578]\\d{5}', 'PossibleNumberPattern' => '\\d{9}', 'ExampleNumber' => '900223456', ), @@ -68,7 +71,6 @@ return array ( 'id' => 'KE', 'countryCode' => 254, 'internationalPrefix' => '000', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_KG b/data/PhoneNumberMetadata_KG index d340125..2339fb5 100644 --- a/data/PhoneNumberMetadata_KG +++ b/data/PhoneNumberMetadata_KG @@ -2,7 +2,7 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[356-8]\\d{8,9}', + 'NationalNumberPattern' => '[35-8]\\d{8,9}', 'PossibleNumberPattern' => '\\d{5,10}', 'ExampleNumber' => '', ), @@ -102,7 +102,6 @@ return array ( 'id' => 'KG', 'countryCode' => 996, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_KH b/data/PhoneNumberMetadata_KH index 7c4f7d3..33c8ddc 100644 --- a/data/PhoneNumberMetadata_KH +++ b/data/PhoneNumberMetadata_KH @@ -26,7 +26,7 @@ return array ( (?: 1[0-35-9]| 6[6-9]| - 7[06-89] + 7[06-9] )[1-9]| 8(?: 0[89]| @@ -80,7 +80,6 @@ return array ( 'id' => 'KH', 'countryCode' => 855, 'internationalPrefix' => '00[178]', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_KI b/data/PhoneNumberMetadata_KI index 34dec80..bcd7e4d 100644 --- a/data/PhoneNumberMetadata_KI +++ b/data/PhoneNumberMetadata_KI @@ -57,7 +57,6 @@ return array ( 'id' => 'KI', 'countryCode' => 686, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => diff --git a/data/PhoneNumberMetadata_KM b/data/PhoneNumberMetadata_KM index 18c49c8..59dc3b5 100644 --- a/data/PhoneNumberMetadata_KM +++ b/data/PhoneNumberMetadata_KM @@ -55,7 +55,6 @@ return array ( 'id' => 'KM', 'countryCode' => 269, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_KN b/data/PhoneNumberMetadata_KN index bfe5959..4bc872a 100644 --- a/data/PhoneNumberMetadata_KN +++ b/data/PhoneNumberMetadata_KN @@ -74,7 +74,6 @@ return array ( 'id' => 'KN', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_KP b/data/PhoneNumberMetadata_KP index 2e636c1..390a785 100644 --- a/data/PhoneNumberMetadata_KP +++ b/data/PhoneNumberMetadata_KP @@ -62,7 +62,6 @@ return array ( 'id' => 'KP', 'countryCode' => 850, 'internationalPrefix' => '00|99', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_KR b/data/PhoneNumberMetadata_KR index 6158d5a..f6b9afd 100644 --- a/data/PhoneNumberMetadata_KR +++ b/data/PhoneNumberMetadata_KR @@ -58,13 +58,23 @@ return array ( 'id' => 'KR', 'countryCode' => 82, 'internationalPrefix' => '00(?:[124-68]|[37]\\d{2})', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0(8[1-46-8]|85\\d{2})?', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( 0 => + array ( + 'pattern' => '(\\d{3})', + 'format' => '$1', + 'leadingDigitsPatterns' => + array ( + 0 => '11[29]', + ), + 'nationalPrefixFormattingRule' => '$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + ), + 1 => array ( 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', 'format' => '$1-$2-$3', @@ -96,7 +106,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 1 => + 2 => array ( 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', 'format' => '$1-$2-$3', @@ -127,7 +137,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 2 => + 3 => array ( 'pattern' => '(\\d{3})(\\d)(\\d{4})', 'format' => '$1-$2-$3', @@ -139,7 +149,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 3 => + 4 => array ( 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', 'format' => '$1-$2-$3', @@ -151,7 +161,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 4 => + 5 => array ( 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', 'format' => '$1-$2-$3', @@ -162,7 +172,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 5 => + 6 => array ( 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{4})', 'format' => '$1-$2-$3-$4', @@ -173,7 +183,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 6 => + 7 => array ( 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', 'format' => '$1-$2-$3', @@ -184,7 +194,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 7 => + 8 => array ( 'pattern' => '(\\d)(\\d{3,4})', 'format' => '$1-$2', @@ -195,7 +205,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 8 => + 9 => array ( 'pattern' => '(\\d{2})(\\d{3,4})', 'format' => '$1-$2', @@ -211,7 +221,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '0$CC-$1', ), - 9 => + 10 => array ( 'pattern' => '(\\d{4})(\\d{4})', 'format' => '$1-$2', diff --git a/data/PhoneNumberMetadata_KW b/data/PhoneNumberMetadata_KW index de12241..5ea2b1c 100644 --- a/data/PhoneNumberMetadata_KW +++ b/data/PhoneNumberMetadata_KW @@ -34,7 +34,7 @@ return array ( 'NationalNumberPattern' => ' (?: 5(?: - 0[0-26]| + 0[0-2568]| 5\\d )| 6(?: @@ -88,7 +88,6 @@ return array ( 'id' => 'KW', 'countryCode' => 965, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_KY b/data/PhoneNumberMetadata_KY index 69b196e..37f6019 100644 --- a/data/PhoneNumberMetadata_KY +++ b/data/PhoneNumberMetadata_KY @@ -21,6 +21,7 @@ return array ( 40 )| 7(?: + 4[35-79]| 6[6-9]| 77 )| @@ -28,8 +29,7 @@ return array ( 00| 1[45]| 25| - 4[89]| - 88 + [48]8 )| 9(?: 14| @@ -44,16 +44,17 @@ return array ( array ( 'NationalNumberPattern' => ' 345(?: - 32[3-79]| + 32[1-9]| 5(?: - 1[467]| + 1[67]| 2[5-7]| - 4[5-9] + 4[6-8]| + 76 )| 9(?: - 1[679]| - 2[4-9]| - 3[89] + 1[67]| + 2[3-9]| + 3[689] ) )\\d{4} ', @@ -98,7 +99,6 @@ return array ( 'id' => 'KY', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_LA b/data/PhoneNumberMetadata_LA index a1695c8..a3a1d7c 100644 --- a/data/PhoneNumberMetadata_LA +++ b/data/PhoneNumberMetadata_LA @@ -2,7 +2,7 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[2-57]\\d{7,9}', + 'NationalNumberPattern' => '[2-8]\\d{7,9}', 'PossibleNumberPattern' => '\\d{6,10}', 'ExampleNumber' => '', ), @@ -10,8 +10,10 @@ return array ( array ( 'NationalNumberPattern' => ' (?: - [2-57]1| - 54 + 2[13]| + [35-7][14]| + 41| + 8[1468] )\\d{6} ', 'PossibleNumberPattern' => '\\d{6,8}', @@ -57,7 +59,6 @@ return array ( 'id' => 'LA', 'countryCode' => 856, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -76,13 +77,13 @@ return array ( ), 1 => array ( - 'pattern' => '([2-57]\\d)(\\d{3})(\\d{3})', + 'pattern' => '([2-8]\\d)(\\d{3})(\\d{3})', 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( 0 => ' - 21| - [3-57] + 2[13]| + [3-8] ', ), 'nationalPrefixFormattingRule' => '0$1', diff --git a/data/PhoneNumberMetadata_LB b/data/PhoneNumberMetadata_LB index d55cb82..f25351e 100644 --- a/data/PhoneNumberMetadata_LB +++ b/data/PhoneNumberMetadata_LB @@ -12,8 +12,9 @@ return array ( (?: [14-6]\\d{2}| 7(?: - [2-57-9]\\d| - 62)| + [2-579]\\d| + 62| + 8[0-7])| [89][2-9]\\d )\\d{4} ', @@ -27,7 +28,8 @@ return array ( 3\\d| 7(?: [01]\\d| - 6[01346-9] + 6[013-9]| + 88 ) )\\d{5} ', @@ -61,7 +63,6 @@ return array ( 'id' => 'LB', 'countryCode' => 961, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -76,8 +77,9 @@ return array ( 0 => ' [13-6]| 7(?: - [2-57-9]| - 62)| + [2-579]| + 62| + 8[0-7])| [89][2-9] ', ), @@ -94,7 +96,8 @@ return array ( [89][01]| 7(?: [01]| - 6[01346-9]) + 6[013-9]| + 88) ', ), 'nationalPrefixFormattingRule' => '', diff --git a/data/PhoneNumberMetadata_LC b/data/PhoneNumberMetadata_LC index f7af291..aeaa493 100644 --- a/data/PhoneNumberMetadata_LC +++ b/data/PhoneNumberMetadata_LC @@ -12,10 +12,12 @@ return array ( 758(?: 234| 4(?: + 30| 5[0-9]| 6[2-9]| 8[0-2] )| + 572| 638| 758 )\\d{4} @@ -40,7 +42,7 @@ return array ( )| 7(?: 1[2-9]| - 2[0-4] + 2[0-6] ) )\\d{4} ', @@ -82,7 +84,6 @@ return array ( 'id' => 'LC', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_LI b/data/PhoneNumberMetadata_LI index 614c833..34767c8 100644 --- a/data/PhoneNumberMetadata_LI +++ b/data/PhoneNumberMetadata_LI @@ -108,7 +108,6 @@ return array ( 'id' => 'LI', 'countryCode' => 423, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_LK b/data/PhoneNumberMetadata_LK index b9be4e7..38ae489 100644 --- a/data/PhoneNumberMetadata_LK +++ b/data/PhoneNumberMetadata_LK @@ -54,7 +54,6 @@ return array ( 'id' => 'LK', 'countryCode' => 94, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_LR b/data/PhoneNumberMetadata_LR index f220cbb..f2d080f 100644 --- a/data/PhoneNumberMetadata_LR +++ b/data/PhoneNumberMetadata_LR @@ -63,7 +63,6 @@ return array ( 'id' => 'LR', 'countryCode' => 231, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_LS b/data/PhoneNumberMetadata_LS index 4bada72..3a2f172 100644 --- a/data/PhoneNumberMetadata_LS +++ b/data/PhoneNumberMetadata_LS @@ -45,7 +45,6 @@ return array ( 'id' => 'LS', 'countryCode' => 266, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_LT b/data/PhoneNumberMetadata_LT index c28b2da..02df445 100644 --- a/data/PhoneNumberMetadata_LT +++ b/data/PhoneNumberMetadata_LT @@ -51,7 +51,6 @@ return array ( 'id' => 'LT', 'countryCode' => 370, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '8', 'nationalPrefixForParsing' => '8', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_LU b/data/PhoneNumberMetadata_LU index 0ce1460..7854bd0 100644 --- a/data/PhoneNumberMetadata_LU +++ b/data/PhoneNumberMetadata_LU @@ -102,7 +102,6 @@ return array ( 'id' => 'LU', 'countryCode' => 352, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefixForParsing' => '(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => @@ -114,7 +113,7 @@ return array ( 'leadingDigitsPatterns' => array ( 0 => ' - [23-5]| + [2-5]| 7[1-9]| [89](?: [1-9]| @@ -132,7 +131,7 @@ return array ( 'leadingDigitsPatterns' => array ( 0 => ' - [23-5]| + [2-5]| 7[1-9]| [89](?: [1-9]| diff --git a/data/PhoneNumberMetadata_LV b/data/PhoneNumberMetadata_LV index e64040f..f22368a 100644 --- a/data/PhoneNumberMetadata_LV +++ b/data/PhoneNumberMetadata_LV @@ -45,7 +45,6 @@ return array ( 'id' => 'LV', 'countryCode' => 371, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_LY b/data/PhoneNumberMetadata_LY index 03c65d3..d0fb716 100644 --- a/data/PhoneNumberMetadata_LY +++ b/data/PhoneNumberMetadata_LY @@ -52,7 +52,6 @@ return array ( 'id' => 'LY', 'countryCode' => 218, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MA b/data/PhoneNumberMetadata_MA index 94fe034..575ef6a 100644 --- a/data/PhoneNumberMetadata_MA +++ b/data/PhoneNumberMetadata_MA @@ -44,10 +44,11 @@ return array ( array ( 'NationalNumberPattern' => ' 6(?: - 0[0-36]| + 0[0-6]| [14-7]\\d| - 2[236]| - 3[348]| + 2[23679]| + 3[03458]| + 8[01]| 99 )\\d{6} ', @@ -81,7 +82,6 @@ return array ( 'id' => 'MA', 'countryCode' => 212, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MC b/data/PhoneNumberMetadata_MC index 16df4d9..3988c3b 100644 --- a/data/PhoneNumberMetadata_MC +++ b/data/PhoneNumberMetadata_MC @@ -53,7 +53,6 @@ return array ( 'id' => 'MC', 'countryCode' => 377, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MD b/data/PhoneNumberMetadata_MD index 63eda65..4cf2dba 100644 --- a/data/PhoneNumberMetadata_MD +++ b/data/PhoneNumberMetadata_MD @@ -2,7 +2,7 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[256-9]\\d{7}', + 'NationalNumberPattern' => '[25-9]\\d{7}', 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '', ), @@ -36,7 +36,7 @@ return array ( 562| 6(?: 50| - 7[1-4]| + 7[1-5]| [089]\\d )| 7(?: @@ -75,7 +75,6 @@ return array ( 'id' => 'MD', 'countryCode' => 373, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_ME b/data/PhoneNumberMetadata_ME index 1791d2b..b8bda7a 100644 --- a/data/PhoneNumberMetadata_ME +++ b/data/PhoneNumberMetadata_ME @@ -84,7 +84,6 @@ return array ( 'id' => 'ME', 'countryCode' => 382, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MF b/data/PhoneNumberMetadata_MF index 125e99c..b9c6e46 100644 --- a/data/PhoneNumberMetadata_MF +++ b/data/PhoneNumberMetadata_MF @@ -60,7 +60,6 @@ return array ( 'id' => 'MF', 'countryCode' => 590, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MG b/data/PhoneNumberMetadata_MG index de3e33c..0a95f49 100644 --- a/data/PhoneNumberMetadata_MG +++ b/data/PhoneNumberMetadata_MG @@ -63,7 +63,6 @@ return array ( 'id' => 'MG', 'countryCode' => 261, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MH b/data/PhoneNumberMetadata_MH index b547735..f655ba0 100644 --- a/data/PhoneNumberMetadata_MH +++ b/data/PhoneNumberMetadata_MH @@ -58,7 +58,6 @@ return array ( 'id' => 'MH', 'countryCode' => 692, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MK b/data/PhoneNumberMetadata_MK index 8897f35..2bfbcf6 100644 --- a/data/PhoneNumberMetadata_MK +++ b/data/PhoneNumberMetadata_MK @@ -13,7 +13,7 @@ return array ( 2(?: [23]\\d| 5[125]| - 61 + 6[01] )| 3(?: 1[3-6]| @@ -72,7 +72,6 @@ return array ( 'id' => 'MK', 'countryCode' => 389, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_ML b/data/PhoneNumberMetadata_ML index 818cd11..ca6db80 100644 --- a/data/PhoneNumberMetadata_ML +++ b/data/PhoneNumberMetadata_ML @@ -71,7 +71,6 @@ return array ( 'id' => 'ML', 'countryCode' => 223, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_MM b/data/PhoneNumberMetadata_MM index 54c3b45..1892c5d 100644 --- a/data/PhoneNumberMetadata_MM +++ b/data/PhoneNumberMetadata_MM @@ -6,10 +6,11 @@ return array ( [124-8]\\d{5,7}| 9(?: [25689]| - [47]\\d + 4\\d{1,2}| + 7\\d )\\d{6} ', - 'PossibleNumberPattern' => '\\d{5,9}', + 'PossibleNumberPattern' => '\\d{5,10}', 'ExampleNumber' => '', ), 'fixedLine' => @@ -40,10 +41,14 @@ return array ( 'NationalNumberPattern' => ' 9(?: [25689]| - [47]\\d + 4(?: + [0256]\\d| + [1349] + )| + 7\\d )\\d{6} ', - 'PossibleNumberPattern' => '\\d{8,9}', + 'PossibleNumberPattern' => '\\d{8,10}', 'ExampleNumber' => '92123456', ), 'tollFree' => @@ -73,7 +78,6 @@ return array ( 'id' => 'MM', 'countryCode' => 95, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -144,7 +148,23 @@ return array ( 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( - 0 => '9[24-9]', + 0 => ' + 9(?: + [25-9]| + 4[1349] + ) + ', + ), + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + ), + 6 => + array ( + 'pattern' => '(9)(4\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => + array ( + 0 => '94[0256]', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', diff --git a/data/PhoneNumberMetadata_MN b/data/PhoneNumberMetadata_MN index 0b8d275..ec19569 100644 --- a/data/PhoneNumberMetadata_MN +++ b/data/PhoneNumberMetadata_MN @@ -68,7 +68,6 @@ return array ( 'id' => 'MN', 'countryCode' => 976, 'internationalPrefix' => '001', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MO b/data/PhoneNumberMetadata_MO index 35a897d..1c2a674 100644 --- a/data/PhoneNumberMetadata_MO +++ b/data/PhoneNumberMetadata_MO @@ -50,7 +50,6 @@ return array ( 'id' => 'MO', 'countryCode' => 853, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_MP b/data/PhoneNumberMetadata_MP index 0ded8b6..b4d1e0a 100644 --- a/data/PhoneNumberMetadata_MP +++ b/data/PhoneNumberMetadata_MP @@ -105,7 +105,6 @@ return array ( 'id' => 'MP', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => true, diff --git a/data/PhoneNumberMetadata_MQ b/data/PhoneNumberMetadata_MQ index dd57d9f..c72f47f 100644 --- a/data/PhoneNumberMetadata_MQ +++ b/data/PhoneNumberMetadata_MQ @@ -61,7 +61,6 @@ return array ( 'id' => 'MQ', 'countryCode' => 596, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MR b/data/PhoneNumberMetadata_MR index d85c383..ab3864d 100644 --- a/data/PhoneNumberMetadata_MR +++ b/data/PhoneNumberMetadata_MR @@ -66,7 +66,6 @@ return array ( 'id' => 'MR', 'countryCode' => 222, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_MS b/data/PhoneNumberMetadata_MS index a8d8a4c..f3ec5b0 100644 --- a/data/PhoneNumberMetadata_MS +++ b/data/PhoneNumberMetadata_MS @@ -14,7 +14,7 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => '664492\\d{4}', + 'NationalNumberPattern' => '66449[2-6]\\d{4}', 'PossibleNumberPattern' => '\\d{10}', 'ExampleNumber' => '6644923456', ), @@ -53,7 +53,6 @@ return array ( 'id' => 'MS', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MT b/data/PhoneNumberMetadata_MT index 649fa43..663a13f 100644 --- a/data/PhoneNumberMetadata_MT +++ b/data/PhoneNumberMetadata_MT @@ -79,7 +79,6 @@ return array ( 'id' => 'MT', 'countryCode' => 356, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_MW b/data/PhoneNumberMetadata_MW index 9247e25..887506c 100644 --- a/data/PhoneNumberMetadata_MW +++ b/data/PhoneNumberMetadata_MW @@ -64,7 +64,6 @@ return array ( 'id' => 'MW', 'countryCode' => 265, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MX b/data/PhoneNumberMetadata_MX index cbc7463..30996bf 100644 --- a/data/PhoneNumberMetadata_MX +++ b/data/PhoneNumberMetadata_MX @@ -179,7 +179,6 @@ return array ( 'id' => 'MX', 'countryCode' => 52, 'internationalPrefix' => '0[09]', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '01', 'nationalPrefixForParsing' => '0[12]|04[45](\\d{10})', 'nationalPrefixTransformRule' => '1$1', diff --git a/data/PhoneNumberMetadata_MY b/data/PhoneNumberMetadata_MY index 2c9e94f..c651812 100644 --- a/data/PhoneNumberMetadata_MY +++ b/data/PhoneNumberMetadata_MY @@ -56,7 +56,6 @@ return array ( 'id' => 'MY', 'countryCode' => 60, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_MZ b/data/PhoneNumberMetadata_MZ index 3f2f236..71f8cb1 100644 --- a/data/PhoneNumberMetadata_MZ +++ b/data/PhoneNumberMetadata_MZ @@ -52,7 +52,6 @@ return array ( 'id' => 'MZ', 'countryCode' => 258, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_NA b/data/PhoneNumberMetadata_NA index 26b32d9..ef8761d 100644 --- a/data/PhoneNumberMetadata_NA +++ b/data/PhoneNumberMetadata_NA @@ -14,7 +14,7 @@ return array ( 17| 2(?: [0189]\\d| - [23-6]| + [2-6]| 7\\d? )| 3(?: @@ -139,7 +139,6 @@ return array ( 'id' => 'NA', 'countryCode' => 264, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_NC b/data/PhoneNumberMetadata_NC index dbe129d..3659be4 100644 --- a/data/PhoneNumberMetadata_NC +++ b/data/PhoneNumberMetadata_NC @@ -58,7 +58,6 @@ return array ( 'id' => 'NC', 'countryCode' => 687, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_NE b/data/PhoneNumberMetadata_NE index 9d7ae0f..96bc6ee 100644 --- a/data/PhoneNumberMetadata_NE +++ b/data/PhoneNumberMetadata_NE @@ -32,7 +32,7 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => '9[0134678]\\d{6}', + 'NationalNumberPattern' => '9[0-46-9]\\d{6}', 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '93123456', ), @@ -63,7 +63,6 @@ return array ( 'id' => 'NE', 'countryCode' => 227, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_NF b/data/PhoneNumberMetadata_NF index 74d7dfb..fe8e426 100644 --- a/data/PhoneNumberMetadata_NF +++ b/data/PhoneNumberMetadata_NF @@ -55,7 +55,6 @@ return array ( 'id' => 'NF', 'countryCode' => 672, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_NG b/data/PhoneNumberMetadata_NG index ee76432..8064337 100644 --- a/data/PhoneNumberMetadata_NG +++ b/data/PhoneNumberMetadata_NG @@ -79,7 +79,6 @@ return array ( 'id' => 'NG', 'countryCode' => 234, 'internationalPrefix' => '009', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_NI b/data/PhoneNumberMetadata_NI index c10c23a..3379b22 100644 --- a/data/PhoneNumberMetadata_NI +++ b/data/PhoneNumberMetadata_NI @@ -45,7 +45,6 @@ return array ( 'id' => 'NI', 'countryCode' => 505, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_NL b/data/PhoneNumberMetadata_NL index 45cf9d0..92db438 100644 --- a/data/PhoneNumberMetadata_NL +++ b/data/PhoneNumberMetadata_NL @@ -58,7 +58,6 @@ return array ( 'id' => 'NL', 'countryCode' => 31, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_NO b/data/PhoneNumberMetadata_NO index 8429e08..e2f1add 100644 --- a/data/PhoneNumberMetadata_NO +++ b/data/PhoneNumberMetadata_NO @@ -28,6 +28,7 @@ return array ( 'NationalNumberPattern' => ' (?: 4[015-8]| + 5[89]| 9\\d )\\d{6} ', @@ -66,7 +67,6 @@ return array ( 'id' => 'NO', 'countryCode' => 47, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_NP b/data/PhoneNumberMetadata_NP index 68255a7..0c7ce36 100644 --- a/data/PhoneNumberMetadata_NP +++ b/data/PhoneNumberMetadata_NP @@ -69,7 +69,6 @@ return array ( 'id' => 'NP', 'countryCode' => 977, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_NR b/data/PhoneNumberMetadata_NR index 7571cda..19b746c 100644 --- a/data/PhoneNumberMetadata_NR +++ b/data/PhoneNumberMetadata_NR @@ -50,7 +50,6 @@ return array ( 'id' => 'NR', 'countryCode' => 674, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_NU b/data/PhoneNumberMetadata_NU index 31b22fa..d47601d 100644 --- a/data/PhoneNumberMetadata_NU +++ b/data/PhoneNumberMetadata_NU @@ -45,7 +45,6 @@ return array ( 'id' => 'NU', 'countryCode' => 683, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_NZ b/data/PhoneNumberMetadata_NZ index c490556..c8b8281 100644 --- a/data/PhoneNumberMetadata_NZ +++ b/data/PhoneNumberMetadata_NZ @@ -27,14 +27,13 @@ return array ( array ( 'NationalNumberPattern' => ' 2(?: - [079]\\d{7}| + [028]\\d{7,8}| 1(?: 0\\d{5,7}| [12]\\d{5,6}| [3-9]\\d{5} )| - [28]\\d{7,8}| - 4[1-9]\\d{6} + [79]\\d{7} ) ', 'PossibleNumberPattern' => '\\d{8,10}', @@ -92,36 +91,41 @@ return array ( ), 1 => array ( - 'pattern' => '(21)(\\d{4})(\\d{3,4})', - 'format' => '$1 $2 $3', + 'pattern' => '(24099)(\\d{3})', + 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( - 0 => '21', + 0 => '240', + 1 => '2409', + 2 => '24099', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), 2 => array ( - 'pattern' => '(22)(\\d{3})(\\d{4})', + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( - 0 => '22', + 0 => '21', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), 3 => array ( - 'pattern' => '([2589]\\d{2})(\\d{3})(\\d{3,4})', + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( 0 => ' - 2[0247-9]| - 5| - [89]00 + 2(?: + 1[1-9]| + [69]| + 7[0-35-9] + )| + 86 ', ), 'nationalPrefixFormattingRule' => '0$1', @@ -129,24 +133,29 @@ return array ( ), 4 => array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'pattern' => '(2\\d)(\\d{3,4})(\\d{4})', 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( - 0 => '2[0169]|86', + 0 => '2[028]', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), 5 => array ( - 'pattern' => '(24099)(\\d{3})', - 'format' => '$1 $2', + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( - 0 => '240', - 1 => '2409', - 2 => '24099', + 0 => ' + 2(?: + 10| + 74 + )| + 5| + [89]0 + ', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', diff --git a/data/PhoneNumberMetadata_OM b/data/PhoneNumberMetadata_OM index a650ba5..8351bd8 100644 --- a/data/PhoneNumberMetadata_OM +++ b/data/PhoneNumberMetadata_OM @@ -55,7 +55,6 @@ return array ( 'id' => 'OM', 'countryCode' => 968, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_PA b/data/PhoneNumberMetadata_PA index c13404a..99a6ec4 100644 --- a/data/PhoneNumberMetadata_PA +++ b/data/PhoneNumberMetadata_PA @@ -16,11 +16,11 @@ return array ( 23| 3[03]| 4[479]| - 5[57]| + 57| 65| 7[016-8]| 8[58]| - 9[1-49] + 9[134] )| 2(?: [0235679]\\d| @@ -38,7 +38,7 @@ return array ( 6[068]| 7[078]| 80| - 9[0-79] + 9\\d )| 4(?: 3[013-59]| @@ -52,13 +52,12 @@ return array ( 79 )| 7(?: - 09| + 0[09]| 2[0-267]| [34]0| 5[6-9]| 7[0-24-7]| - 8[89]| - 99 + 8[89] )| 8(?: [34]\\d| @@ -86,7 +85,7 @@ return array ( array ( 'NationalNumberPattern' => ' (?: - 161| + 1[16]1| 21[89]| 8(?: 1[01]| @@ -94,11 +93,10 @@ return array ( ) )\\d{4}| 6(?: - [04-8]\\d| + [04-9]\\d| 1[0-5]| - 2[0-4]| - 3[7-9]| - 9[0-8] + 2[0-6]| + 3[6-9] )\\d{5} ', 'PossibleNumberPattern' => '\\d{7,8}', @@ -146,7 +144,6 @@ return array ( 'id' => 'PA', 'countryCode' => 507, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_PE b/data/PhoneNumberMetadata_PE index 44fd0ed..7293452 100644 --- a/data/PhoneNumberMetadata_PE +++ b/data/PhoneNumberMetadata_PE @@ -54,7 +54,6 @@ return array ( 'id' => 'PE', 'countryCode' => 51, 'internationalPrefix' => '19(?:1[124]|77|90)00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'preferredExtnPrefix' => ' Anexo ', 'nationalPrefixForParsing' => '0', diff --git a/data/PhoneNumberMetadata_PF b/data/PhoneNumberMetadata_PF index c902375..99ae073 100644 --- a/data/PhoneNumberMetadata_PF +++ b/data/PhoneNumberMetadata_PF @@ -65,7 +65,6 @@ return array ( 'id' => 'PF', 'countryCode' => 689, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_PG b/data/PhoneNumberMetadata_PG index 3f6ab35..e05b432 100644 --- a/data/PhoneNumberMetadata_PG +++ b/data/PhoneNumberMetadata_PG @@ -62,7 +62,6 @@ return array ( 'id' => 'PG', 'countryCode' => 675, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_PH b/data/PhoneNumberMetadata_PH index 4b31ec1..f1cc4bc 100644 --- a/data/PhoneNumberMetadata_PH +++ b/data/PhoneNumberMetadata_PH @@ -69,7 +69,6 @@ return array ( 'id' => 'PH', 'countryCode' => 63, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_PK b/data/PhoneNumberMetadata_PK index 12e0aa4..ddc14cb 100644 --- a/data/PhoneNumberMetadata_PK +++ b/data/PhoneNumberMetadata_PK @@ -67,10 +67,10 @@ return array ( 'NationalNumberPattern' => ' 3(?: 0\\d| - 1[2-5]| - 2[1-5]| + [12][1-5]| 3[1-6]| 4[1-7]| + 55| 64 )\\d{7} ', @@ -104,7 +104,6 @@ return array ( 'id' => 'PK', 'countryCode' => 92, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_PL b/data/PhoneNumberMetadata_PL index 4f9b266..cc0a3ed 100644 --- a/data/PhoneNumberMetadata_PL +++ b/data/PhoneNumberMetadata_PL @@ -72,7 +72,6 @@ return array ( 'id' => 'PL', 'countryCode' => 48, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_PM b/data/PhoneNumberMetadata_PM index de2bdd1..d8fdadb 100644 --- a/data/PhoneNumberMetadata_PM +++ b/data/PhoneNumberMetadata_PM @@ -45,7 +45,6 @@ return array ( 'id' => 'PM', 'countryCode' => 508, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_PR b/data/PhoneNumberMetadata_PR index a67fa1b..b6234ad 100644 --- a/data/PhoneNumberMetadata_PR +++ b/data/PhoneNumberMetadata_PR @@ -63,7 +63,6 @@ return array ( 'id' => 'PR', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => true, diff --git a/data/PhoneNumberMetadata_PS b/data/PhoneNumberMetadata_PS index 47b1ad3..e27fc12 100644 --- a/data/PhoneNumberMetadata_PS +++ b/data/PhoneNumberMetadata_PS @@ -63,7 +63,6 @@ return array ( 'id' => 'PS', 'countryCode' => 970, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_PT b/data/PhoneNumberMetadata_PT index 4a7a8bc..c383561 100644 --- a/data/PhoneNumberMetadata_PT +++ b/data/PhoneNumberMetadata_PT @@ -67,7 +67,6 @@ return array ( 'id' => 'PT', 'countryCode' => 351, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_PW b/data/PhoneNumberMetadata_PW index cf7d258..a3ae8ce 100644 --- a/data/PhoneNumberMetadata_PW +++ b/data/PhoneNumberMetadata_PW @@ -76,7 +76,6 @@ return array ( 'id' => 'PW', 'countryCode' => 680, 'internationalPrefix' => '01[12]', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_PY b/data/PhoneNumberMetadata_PY index c20f102..e420201 100644 --- a/data/PhoneNumberMetadata_PY +++ b/data/PhoneNumberMetadata_PY @@ -102,7 +102,6 @@ return array ( 'id' => 'PY', 'countryCode' => 595, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_QA b/data/PhoneNumberMetadata_QA index 7a962a0..1d19b44 100644 --- a/data/PhoneNumberMetadata_QA +++ b/data/PhoneNumberMetadata_QA @@ -45,7 +45,6 @@ return array ( 'id' => 'QA', 'countryCode' => 974, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_RE b/data/PhoneNumberMetadata_RE index 199c22f..818fe6d 100644 --- a/data/PhoneNumberMetadata_RE +++ b/data/PhoneNumberMetadata_RE @@ -57,7 +57,6 @@ return array ( 'id' => 'RE', 'countryCode' => 262, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_RO b/data/PhoneNumberMetadata_RO index 1ee3695..c5ba1a9 100644 --- a/data/PhoneNumberMetadata_RO +++ b/data/PhoneNumberMetadata_RO @@ -45,7 +45,6 @@ return array ( 'id' => 'RO', 'countryCode' => 40, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'preferredExtnPrefix' => ' int ', 'nationalPrefixForParsing' => '0', diff --git a/data/PhoneNumberMetadata_RS b/data/PhoneNumberMetadata_RS index 46686bb..ee4cf8a 100644 --- a/data/PhoneNumberMetadata_RS +++ b/data/PhoneNumberMetadata_RS @@ -82,7 +82,6 @@ return array ( 'id' => 'RS', 'countryCode' => 381, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_RW b/data/PhoneNumberMetadata_RW index dbfc6e6..00335ea 100644 --- a/data/PhoneNumberMetadata_RW +++ b/data/PhoneNumberMetadata_RW @@ -48,7 +48,6 @@ return array ( 'id' => 'RW', 'countryCode' => 250, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_SA b/data/PhoneNumberMetadata_SA index c9d12fe..9b0d122 100644 --- a/data/PhoneNumberMetadata_SA +++ b/data/PhoneNumberMetadata_SA @@ -19,7 +19,7 @@ return array ( (?: [12][24-8]| 3[35-8]| - 4[34-68]| + 4[3-68]| 6[2-5]| 7[235-7] )\\d{6} @@ -65,7 +65,6 @@ return array ( 'id' => 'SA', 'countryCode' => 966, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_SB b/data/PhoneNumberMetadata_SB index dd28193..7881150 100644 --- a/data/PhoneNumberMetadata_SB +++ b/data/PhoneNumberMetadata_SB @@ -23,14 +23,15 @@ return array ( 'mobile' => array ( 'NationalNumberPattern' => ' + 48\\d{3}| 7(?: 4\\d| 5[025-8]| - 6[01] + 6[0-4] )\\d{4}| 8[4-8]\\d{5} ', - 'PossibleNumberPattern' => '\\d{7}', + 'PossibleNumberPattern' => '\\d{5,7}', 'ExampleNumber' => '7421234', ), 'tollFree' => @@ -60,7 +61,6 @@ return array ( 'id' => 'SB', 'countryCode' => 677, 'internationalPrefix' => '0[01]', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_SC b/data/PhoneNumberMetadata_SC index 633be40..5da97da 100644 --- a/data/PhoneNumberMetadata_SC +++ b/data/PhoneNumberMetadata_SC @@ -8,40 +8,13 @@ return array ( ), 'fixedLine' => array ( - 'NationalNumberPattern' => ' - (?: - 2(?: - 55[0-5]| - 78[013] - )| - 4(?: - 2(?: - 0[589]| - 1[03-9]| - [2-9]\\d - )| - [346]\\d{2} - ) - )\\d{3} - ', + 'NationalNumberPattern' => '4[2-46]\\d{5}', 'PossibleNumberPattern' => '\\d{7}', 'ExampleNumber' => '4217123', ), 'mobile' => array ( - 'NationalNumberPattern' => ' - 2(?: - 5(?: - [0-46-9]\\d| - 5[6-9] - )| - 7(?: - [0-79]\\d| - 8[24-9] - )| - 8\\d{2} - )\\d{3} - ', + 'NationalNumberPattern' => '2[5-8]\\d{5}', 'PossibleNumberPattern' => '\\d{7}', 'ExampleNumber' => '2510123', ), diff --git a/data/PhoneNumberMetadata_SD b/data/PhoneNumberMetadata_SD index d9f4216..59be514 100644 --- a/data/PhoneNumberMetadata_SD +++ b/data/PhoneNumberMetadata_SD @@ -50,7 +50,6 @@ return array ( 'id' => 'SD', 'countryCode' => 249, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_SE b/data/PhoneNumberMetadata_SE index 9ee8138..a5599af 100644 --- a/data/PhoneNumberMetadata_SE +++ b/data/PhoneNumberMetadata_SE @@ -46,7 +46,7 @@ return array ( 4(?: [0246]\\d{5,7}| (?: - 1[01-8]| + 1[0-8]| 3[0135]| 5[14-79]| 7[0-246-9]| @@ -136,7 +136,6 @@ return array ( 'id' => 'SE', 'countryCode' => 46, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_SG b/data/PhoneNumberMetadata_SG index 775473f..63b22d3 100644 --- a/data/PhoneNumberMetadata_SG +++ b/data/PhoneNumberMetadata_SG @@ -53,7 +53,6 @@ return array ( 'id' => 'SG', 'countryCode' => 65, 'internationalPrefix' => '0[0-3][0-9]', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_SH b/data/PhoneNumberMetadata_SH index 62c7742..90d5453 100644 --- a/data/PhoneNumberMetadata_SH +++ b/data/PhoneNumberMetadata_SH @@ -55,7 +55,6 @@ return array ( 'id' => 'SH', 'countryCode' => 290, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_SI b/data/PhoneNumberMetadata_SI index 050653f..a9bb640 100644 --- a/data/PhoneNumberMetadata_SI +++ b/data/PhoneNumberMetadata_SI @@ -30,7 +30,7 @@ return array ( [37][01]| 4[019]| 51| - 64 + 6[48] )\\d{6} ', 'PossibleNumberPattern' => '\\d{8}', @@ -66,7 +66,6 @@ return array ( 'id' => 'SI', 'countryCode' => 386, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -99,7 +98,7 @@ return array ( [37][01]| 4[019]| 51| - 64 + 6 ', ), 'nationalPrefixFormattingRule' => '0$1', diff --git a/data/PhoneNumberMetadata_SJ b/data/PhoneNumberMetadata_SJ index 6740ea0..81113ae 100644 --- a/data/PhoneNumberMetadata_SJ +++ b/data/PhoneNumberMetadata_SJ @@ -20,6 +20,7 @@ return array ( 'NationalNumberPattern' => ' (?: 4[015-8]| + 5[89]| 9\\d )\\d{6} ', @@ -58,7 +59,6 @@ return array ( 'id' => 'SJ', 'countryCode' => 47, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_SK b/data/PhoneNumberMetadata_SK index d0a25fd..fec8c21 100644 --- a/data/PhoneNumberMetadata_SK +++ b/data/PhoneNumberMetadata_SK @@ -56,7 +56,6 @@ return array ( 'id' => 'SK', 'countryCode' => 421, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_SL b/data/PhoneNumberMetadata_SL index a2f3463..d7d6ba8 100644 --- a/data/PhoneNumberMetadata_SL +++ b/data/PhoneNumberMetadata_SL @@ -20,9 +20,9 @@ return array ( 3[03]| 44| 5[056]| - 7[6-8]| + 7[6-9]| 88 - )[1-9]\\d{5} + )\\d{6} ', 'PossibleNumberPattern' => '\\d{6,8}', 'ExampleNumber' => '25123456', @@ -54,7 +54,6 @@ return array ( 'id' => 'SL', 'countryCode' => 232, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_SM b/data/PhoneNumberMetadata_SM index 01611b1..f85bfc9 100644 --- a/data/PhoneNumberMetadata_SM +++ b/data/PhoneNumberMetadata_SM @@ -50,7 +50,6 @@ return array ( 'id' => 'SM', 'countryCode' => 378, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefixForParsing' => '(?:0549)?([89]\\d{5})', 'nationalPrefixTransformRule' => '0549$1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_SN b/data/PhoneNumberMetadata_SN index d80cc08..f35618f 100644 --- a/data/PhoneNumberMetadata_SN +++ b/data/PhoneNumberMetadata_SN @@ -37,8 +37,7 @@ return array ( )| 7(?: 01| - [12-79]\\d| - 8[0139] + [1-9]\\d ) )\\d{5} ', @@ -72,7 +71,6 @@ return array ( 'id' => 'SN', 'countryCode' => 221, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_SO b/data/PhoneNumberMetadata_SO index d74d00a..6f876b5 100644 --- a/data/PhoneNumberMetadata_SO +++ b/data/PhoneNumberMetadata_SO @@ -10,8 +10,9 @@ return array ( array ( 'NationalNumberPattern' => ' (?: - 5[57-9]| - [1-4]\\d + [134]\\d| + 2[0-79]| + 5[57-9] )\\d{5} ', 'PossibleNumberPattern' => '\\d{7}', @@ -21,14 +22,17 @@ return array ( array ( 'NationalNumberPattern' => ' (?: - 15| - 24| - 6[179]?\\d| - 7\\d| - 9[01] - )\\d{6} + 15\\d| + 2(?: + 4\\d| + 8 + )| + 6[17-9]?\\d{2}| + 7\\d{2}| + 9[01]\\d + )\\d{5} ', - 'PossibleNumberPattern' => '\\d{8,9}', + 'PossibleNumberPattern' => '\\d{7,9}', 'ExampleNumber' => '90792024', ), 'tollFree' => @@ -58,7 +62,6 @@ return array ( 'id' => 'SO', 'countryCode' => 252, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -70,7 +73,10 @@ return array ( 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( - 0 => '[1-5]', + 0 => ' + 2[0-79]| + [13-5] + ', ), 'nationalPrefixFormattingRule' => '', 'domesticCarrierCodeFormattingRule' => '', @@ -81,19 +87,24 @@ return array ( 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( - 0 => '[267]', + 0 => ' + 24| + [67] + ', ), 'nationalPrefixFormattingRule' => '', 'domesticCarrierCodeFormattingRule' => '', ), 2 => array ( - 'pattern' => '([19]\\d)(\\d{6})', + 'pattern' => '(\\d{2})(\\d{5,7})', 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( 0 => ' 15| + 28| + 6[178]| 9 ', ), @@ -101,17 +112,6 @@ return array ( 'domesticCarrierCodeFormattingRule' => '', ), 3 => - array ( - 'pattern' => '(6\\d)(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '6[17]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - ), - 4 => array ( 'pattern' => '(69\\d)(\\d{6})', 'format' => '$1 $2', diff --git a/data/PhoneNumberMetadata_SR b/data/PhoneNumberMetadata_SR index ab03bfd..ed45223 100644 --- a/data/PhoneNumberMetadata_SR +++ b/data/PhoneNumberMetadata_SR @@ -58,7 +58,6 @@ return array ( 'id' => 'SR', 'countryCode' => 597, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_SS b/data/PhoneNumberMetadata_SS index 59b1460..7c82f91 100644 --- a/data/PhoneNumberMetadata_SS +++ b/data/PhoneNumberMetadata_SS @@ -66,7 +66,6 @@ return array ( 'id' => 'SS', 'countryCode' => 211, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_ST b/data/PhoneNumberMetadata_ST index ead5a46..7d21cd7 100644 --- a/data/PhoneNumberMetadata_ST +++ b/data/PhoneNumberMetadata_ST @@ -45,7 +45,6 @@ return array ( 'id' => 'ST', 'countryCode' => 239, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_SV b/data/PhoneNumberMetadata_SV index 8a5e844..a6c8264 100644 --- a/data/PhoneNumberMetadata_SV +++ b/data/PhoneNumberMetadata_SV @@ -51,7 +51,6 @@ return array ( 'id' => 'SV', 'countryCode' => 503, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_SX b/data/PhoneNumberMetadata_SX index a29f8b0..36334b8 100644 --- a/data/PhoneNumberMetadata_SX +++ b/data/PhoneNumberMetadata_SX @@ -65,7 +65,6 @@ return array ( 'id' => 'SX', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_SY b/data/PhoneNumberMetadata_SY index f5044d7..9366819 100644 --- a/data/PhoneNumberMetadata_SY +++ b/data/PhoneNumberMetadata_SY @@ -31,12 +31,13 @@ return array ( array ( 'NationalNumberPattern' => ' 9(?: - 3[23]| - 4[457]| - 55| - 6[67]| + 22| + 3[1-356]| + 4\\d| + 5[024-7]| + 6[26-9]| 88| - 9[1-49] + 9[0-489] )\\d{6} ', 'PossibleNumberPattern' => '\\d{9}', @@ -69,7 +70,6 @@ return array ( 'id' => 'SY', 'countryCode' => 963, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -88,7 +88,7 @@ return array ( ), 1 => array ( - 'pattern' => '(9[3-689])(\\d{4})(\\d{3})', + 'pattern' => '(9\\d{2})(\\d{3})(\\d{3})', 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( diff --git a/data/PhoneNumberMetadata_SZ b/data/PhoneNumberMetadata_SZ index 7758f03..c9af9bc 100644 --- a/data/PhoneNumberMetadata_SZ +++ b/data/PhoneNumberMetadata_SZ @@ -70,7 +70,6 @@ return array ( 'id' => 'SZ', 'countryCode' => 268, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_TC b/data/PhoneNumberMetadata_TC index 7852095..3ff4737 100644 --- a/data/PhoneNumberMetadata_TC +++ b/data/PhoneNumberMetadata_TC @@ -26,11 +26,11 @@ return array ( 649(?: 2(?: 3[12]| - 4[1-5] + 4[1-7] )| 3(?: 3[1-39]| - 4[1-57] + 4[1-7] )| 4[34][12] )\\d{4} @@ -73,7 +73,6 @@ return array ( 'id' => 'TC', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_TG b/data/PhoneNumberMetadata_TG index 5a06ada..8855542 100644 --- a/data/PhoneNumberMetadata_TG +++ b/data/PhoneNumberMetadata_TG @@ -54,7 +54,6 @@ return array ( 'id' => 'TG', 'countryCode' => 228, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_TH b/data/PhoneNumberMetadata_TH index 6179ac3..0576f67 100644 --- a/data/PhoneNumberMetadata_TH +++ b/data/PhoneNumberMetadata_TH @@ -56,7 +56,6 @@ return array ( 'id' => 'TH', 'countryCode' => 66, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_TK b/data/PhoneNumberMetadata_TK index 09dbcc6..7333fd8 100644 --- a/data/PhoneNumberMetadata_TK +++ b/data/PhoneNumberMetadata_TK @@ -45,7 +45,6 @@ return array ( 'id' => 'TK', 'countryCode' => 690, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_TL b/data/PhoneNumberMetadata_TL index 252aa56..3f16c66 100644 --- a/data/PhoneNumberMetadata_TL +++ b/data/PhoneNumberMetadata_TL @@ -51,7 +51,6 @@ return array ( 'id' => 'TL', 'countryCode' => 670, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_TN b/data/PhoneNumberMetadata_TN index 45fb625..959a84c 100644 --- a/data/PhoneNumberMetadata_TN +++ b/data/PhoneNumberMetadata_TN @@ -2,13 +2,18 @@ return array ( 'generalDesc' => array ( - 'NationalNumberPattern' => '[2457-9]\\d{7}', + 'NationalNumberPattern' => '[2-57-9]\\d{7}', 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '', ), 'fixedLine' => array ( - 'NationalNumberPattern' => '7\\d{7}', + 'NationalNumberPattern' => ' + (?: + 3[012]| + 7\\d + )\\d{6} + ', 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '71234567', ), @@ -16,9 +21,8 @@ return array ( array ( 'NationalNumberPattern' => ' (?: - [29]\\d| - 4[01]| - 5[01258]| + [259]\\d| + 4[01] )\\d{6} ', 'PossibleNumberPattern' => '\\d{8}', @@ -32,7 +36,7 @@ return array ( ), 'premiumRate' => array ( - 'NationalNumberPattern' => '8[028]\\d{6}', + 'NationalNumberPattern' => '8[0128]\\d{6}', 'PossibleNumberPattern' => '\\d{8}', 'ExampleNumber' => '80123456', ), @@ -51,7 +55,6 @@ return array ( 'id' => 'TN', 'countryCode' => 216, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_TO b/data/PhoneNumberMetadata_TO index c04b4a4..eaf19af 100644 --- a/data/PhoneNumberMetadata_TO +++ b/data/PhoneNumberMetadata_TO @@ -59,7 +59,6 @@ return array ( 'id' => 'TO', 'countryCode' => 676, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_TR b/data/PhoneNumberMetadata_TR index d3f6a25..314637e 100644 --- a/data/PhoneNumberMetadata_TR +++ b/data/PhoneNumberMetadata_TR @@ -77,7 +77,6 @@ return array ( 'id' => 'TR', 'countryCode' => 90, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_TT b/data/PhoneNumberMetadata_TT index 395e6ec..1de20c6 100644 --- a/data/PhoneNumberMetadata_TT +++ b/data/PhoneNumberMetadata_TT @@ -92,7 +92,6 @@ return array ( 'id' => 'TT', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_TV b/data/PhoneNumberMetadata_TV index 6b0eb88..3e57093 100644 --- a/data/PhoneNumberMetadata_TV +++ b/data/PhoneNumberMetadata_TV @@ -45,7 +45,6 @@ return array ( 'id' => 'TV', 'countryCode' => 688, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_TW b/data/PhoneNumberMetadata_TW index 5e9f2ad..7101ffe 100644 --- a/data/PhoneNumberMetadata_TW +++ b/data/PhoneNumberMetadata_TW @@ -45,7 +45,6 @@ return array ( 'id' => 'TW', 'countryCode' => 886, 'internationalPrefix' => '0(?:0[25679]|19)', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'preferredExtnPrefix' => '#', 'nationalPrefixForParsing' => '0', diff --git a/data/PhoneNumberMetadata_TZ b/data/PhoneNumberMetadata_TZ index 35d6d8d..6e11afa 100644 --- a/data/PhoneNumberMetadata_TZ +++ b/data/PhoneNumberMetadata_TZ @@ -55,7 +55,6 @@ return array ( 'id' => 'TZ', 'countryCode' => 255, 'internationalPrefix' => '00[056]', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_UG b/data/PhoneNumberMetadata_UG index 4ff2eda..fdb8ae6 100644 --- a/data/PhoneNumberMetadata_UG +++ b/data/PhoneNumberMetadata_UG @@ -63,7 +63,6 @@ return array ( 'id' => 'UG', 'countryCode' => 256, 'internationalPrefix' => '00[057]', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_US b/data/PhoneNumberMetadata_US index 3f420a9..487ebb4 100644 --- a/data/PhoneNumberMetadata_US +++ b/data/PhoneNumberMetadata_US @@ -229,7 +229,6 @@ return array ( 'id' => 'US', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => true, diff --git a/data/PhoneNumberMetadata_UZ b/data/PhoneNumberMetadata_UZ index 6cc8811..79dd369 100644 --- a/data/PhoneNumberMetadata_UZ +++ b/data/PhoneNumberMetadata_UZ @@ -34,6 +34,7 @@ return array ( 7[69]| )| 9(?: + 22| 4[1-8]| 6[135] ) @@ -61,7 +62,7 @@ return array ( )| 4(?: 2\\d| - 3[1-4579]| + 3[1-579]| 7[1-79] )| 5(?: diff --git a/data/PhoneNumberMetadata_VA b/data/PhoneNumberMetadata_VA index 3c4a56e..1cbd24e 100644 --- a/data/PhoneNumberMetadata_VA +++ b/data/PhoneNumberMetadata_VA @@ -45,7 +45,6 @@ return array ( 'id' => 'VA', 'countryCode' => 379, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_VC b/data/PhoneNumberMetadata_VC index fb21781..c99c86b 100644 --- a/data/PhoneNumberMetadata_VC +++ b/data/PhoneNumberMetadata_VC @@ -84,7 +84,6 @@ return array ( 'id' => 'VC', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_VE b/data/PhoneNumberMetadata_VE index 901a3e0..f94fe64 100644 --- a/data/PhoneNumberMetadata_VE +++ b/data/PhoneNumberMetadata_VE @@ -61,7 +61,6 @@ return array ( 'id' => 'VE', 'countryCode' => 58, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '(1\\d{2})|0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_VG b/data/PhoneNumberMetadata_VG index 6d75b75..46861d6 100644 --- a/data/PhoneNumberMetadata_VG +++ b/data/PhoneNumberMetadata_VG @@ -85,7 +85,6 @@ return array ( 'id' => 'VG', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_VI b/data/PhoneNumberMetadata_VI index 7300b14..b1efd03 100644 --- a/data/PhoneNumberMetadata_VI +++ b/data/PhoneNumberMetadata_VI @@ -119,7 +119,6 @@ return array ( 'id' => 'VI', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => true, diff --git a/data/PhoneNumberMetadata_VN b/data/PhoneNumberMetadata_VN index 2359be9..935c7b1 100644 --- a/data/PhoneNumberMetadata_VN +++ b/data/PhoneNumberMetadata_VN @@ -49,7 +49,7 @@ return array ( 9\\d| 1(?: 2\\d| - 6[3-9]| + 6[2-9]| 8[68]| 99 ) @@ -88,7 +88,6 @@ return array ( 'id' => 'VN', 'countryCode' => 84, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_VU b/data/PhoneNumberMetadata_VU index 6a88ed5..8650147 100644 --- a/data/PhoneNumberMetadata_VU +++ b/data/PhoneNumberMetadata_VU @@ -63,7 +63,6 @@ return array ( 'id' => 'VU', 'countryCode' => 678, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_WF b/data/PhoneNumberMetadata_WF index 8140efc..f49d0dc 100644 --- a/data/PhoneNumberMetadata_WF +++ b/data/PhoneNumberMetadata_WF @@ -57,7 +57,6 @@ return array ( 'id' => 'WF', 'countryCode' => 681, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_WS b/data/PhoneNumberMetadata_WS index 853c558..28e2a3a 100644 --- a/data/PhoneNumberMetadata_WS +++ b/data/PhoneNumberMetadata_WS @@ -56,7 +56,6 @@ return array ( 'id' => 'WS', 'countryCode' => 685, 'internationalPrefix' => '0', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadata_YE b/data/PhoneNumberMetadata_YE index 9f89837..99d92be 100644 --- a/data/PhoneNumberMetadata_YE +++ b/data/PhoneNumberMetadata_YE @@ -58,7 +58,6 @@ return array ( 'id' => 'YE', 'countryCode' => 967, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_YT b/data/PhoneNumberMetadata_YT index 46d6260..a1bf92e 100644 --- a/data/PhoneNumberMetadata_YT +++ b/data/PhoneNumberMetadata_YT @@ -45,7 +45,6 @@ return array ( 'id' => 'YT', 'countryCode' => 262, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_ZA b/data/PhoneNumberMetadata_ZA index cfe4bf5..d865702 100644 --- a/data/PhoneNumberMetadata_ZA +++ b/data/PhoneNumberMetadata_ZA @@ -65,7 +65,6 @@ return array ( 'id' => 'ZA', 'countryCode' => 27, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_ZM b/data/PhoneNumberMetadata_ZM index a6b529b..2fe7508 100644 --- a/data/PhoneNumberMetadata_ZM +++ b/data/PhoneNumberMetadata_ZM @@ -51,7 +51,6 @@ return array ( 'id' => 'ZM', 'countryCode' => 260, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadata_ZW b/data/PhoneNumberMetadata_ZW index a6ada77..200bd8e 100644 --- a/data/PhoneNumberMetadata_ZW +++ b/data/PhoneNumberMetadata_ZW @@ -78,8 +78,14 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => '7[137]\\d{7}', - 'PossibleNumberPattern' => '\\d{9}', + 'NationalNumberPattern' => ' + 7[137]\\d{7}| + 86(?: + 22| + 44 + )\\d{6} + ', + 'PossibleNumberPattern' => '\\d{9,10}', 'ExampleNumber' => '711234567', ), 'tollFree' => @@ -109,7 +115,6 @@ return array ( 'id' => 'ZW', 'countryCode' => 263, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, @@ -144,6 +149,17 @@ return array ( 'domesticCarrierCodeFormattingRule' => '', ), 2 => + array ( + 'pattern' => '(86\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => + array ( + 0 => '86[24]', + ), + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + ), + 3 => array ( 'pattern' => '([1-356]\\d)(\\d{3,5})', 'format' => '$1 $2', @@ -177,7 +193,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), - 3 => + 4 => array ( 'pattern' => '([1-356]\\d)(\\d{3})(\\d{3})', 'format' => '$1 $2 $3', @@ -211,7 +227,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), - 4 => + 5 => array ( 'pattern' => '([2356]\\d{2})(\\d{3,5})', 'format' => '$1 $2', @@ -240,7 +256,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), - 5 => + 6 => array ( 'pattern' => '([2356]\\d{2})(\\d{3})(\\d{3})', 'format' => '$1 $2 $3', @@ -269,7 +285,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), - 6 => + 7 => array ( 'pattern' => '([25]\\d{3})(\\d{3,5})', 'format' => '$1 $2', @@ -289,7 +305,7 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), - 7 => + 8 => array ( 'pattern' => '([25]\\d{3})(\\d{3})(\\d{3})', 'format' => '$1 $2 $3', @@ -309,13 +325,13 @@ return array ( 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), - 8 => + 9 => array ( 'pattern' => '(8\\d{3})(\\d{6})', 'format' => '$1 $2', 'leadingDigitsPatterns' => array ( - 0 => '8', + 0 => '86[1389]', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', From b7a1b915ec1cf617e0b20a689089febabe014934 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Fri, 18 May 2012 13:04:57 +0530 Subject: [PATCH 04/13] Updates Testing MetaData on PhoneNumber Plan & formatting rules from GoogleCode --- data/PhoneNumberMetadataForTesting_800 | 1 - data/PhoneNumberMetadataForTesting_AD | 1 - data/PhoneNumberMetadataForTesting_AO | 1 - data/PhoneNumberMetadataForTesting_AR | 1 - data/PhoneNumberMetadataForTesting_BR | 1 - data/PhoneNumberMetadataForTesting_BS | 1 - data/PhoneNumberMetadataForTesting_DE | 1 - data/PhoneNumberMetadataForTesting_GB | 1 - data/PhoneNumberMetadataForTesting_IT | 1 - data/PhoneNumberMetadataForTesting_JP | 1 - data/PhoneNumberMetadataForTesting_KR | 1 - data/PhoneNumberMetadataForTesting_MX | 1 - data/PhoneNumberMetadataForTesting_NZ | 1 - data/PhoneNumberMetadataForTesting_PL | 1 - data/PhoneNumberMetadataForTesting_RE | 1 - data/PhoneNumberMetadataForTesting_SG | 1 - data/PhoneNumberMetadataForTesting_US | 1 - data/PhoneNumberMetadataForTesting_YT | 1 - 18 files changed, 18 deletions(-) diff --git a/data/PhoneNumberMetadataForTesting_800 b/data/PhoneNumberMetadataForTesting_800 index a01e866..753a90b 100644 --- a/data/PhoneNumberMetadataForTesting_800 +++ b/data/PhoneNumberMetadataForTesting_800 @@ -45,7 +45,6 @@ return array ( 'id' => '001', 'countryCode' => 800, 'internationalPrefix' => '', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadataForTesting_AD b/data/PhoneNumberMetadataForTesting_AD index 2aeb1c1..f6796d4 100644 --- a/data/PhoneNumberMetadataForTesting_AD +++ b/data/PhoneNumberMetadataForTesting_AD @@ -45,7 +45,6 @@ return array ( 'id' => 'AD', 'countryCode' => 376, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => true, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadataForTesting_AO b/data/PhoneNumberMetadataForTesting_AO index b841675..0227750 100644 --- a/data/PhoneNumberMetadataForTesting_AO +++ b/data/PhoneNumberMetadataForTesting_AO @@ -45,7 +45,6 @@ return array ( 'id' => 'AO', 'countryCode' => 244, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0~0', 'nationalPrefixForParsing' => '0~0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadataForTesting_AR b/data/PhoneNumberMetadataForTesting_AR index 0ce8ba8..a01822d 100644 --- a/data/PhoneNumberMetadataForTesting_AR +++ b/data/PhoneNumberMetadataForTesting_AR @@ -45,7 +45,6 @@ return array ( 'id' => 'AR', 'countryCode' => 54, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0(?:(11|343|3715)15)?', 'nationalPrefixTransformRule' => '9$1', diff --git a/data/PhoneNumberMetadataForTesting_BR b/data/PhoneNumberMetadataForTesting_BR index f2fc8b4..64aba3b 100644 --- a/data/PhoneNumberMetadataForTesting_BR +++ b/data/PhoneNumberMetadataForTesting_BR @@ -45,7 +45,6 @@ return array ( 'id' => 'BR', 'countryCode' => 55, 'internationalPrefix' => '0014', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => true, diff --git a/data/PhoneNumberMetadataForTesting_BS b/data/PhoneNumberMetadataForTesting_BS index 46432a4..422acb0 100644 --- a/data/PhoneNumberMetadataForTesting_BS +++ b/data/PhoneNumberMetadataForTesting_BS @@ -45,7 +45,6 @@ return array ( 'id' => 'BS', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'nationalPrefixForParsing' => '1', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadataForTesting_DE b/data/PhoneNumberMetadataForTesting_DE index e7d28a5..8bde761 100644 --- a/data/PhoneNumberMetadataForTesting_DE +++ b/data/PhoneNumberMetadataForTesting_DE @@ -45,7 +45,6 @@ return array ( 'id' => 'DE', 'countryCode' => 49, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadataForTesting_GB b/data/PhoneNumberMetadataForTesting_GB index 3a0b96e..d83da54 100644 --- a/data/PhoneNumberMetadataForTesting_GB +++ b/data/PhoneNumberMetadataForTesting_GB @@ -45,7 +45,6 @@ return array ( 'id' => 'GB', 'countryCode' => 44, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadataForTesting_IT b/data/PhoneNumberMetadataForTesting_IT index 81f3a03..a7adb6b 100644 --- a/data/PhoneNumberMetadataForTesting_IT +++ b/data/PhoneNumberMetadataForTesting_IT @@ -45,7 +45,6 @@ return array ( 'id' => 'IT', 'countryCode' => 39, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => array ( diff --git a/data/PhoneNumberMetadataForTesting_JP b/data/PhoneNumberMetadataForTesting_JP index 44027c7..6f56f60 100644 --- a/data/PhoneNumberMetadataForTesting_JP +++ b/data/PhoneNumberMetadataForTesting_JP @@ -45,7 +45,6 @@ return array ( 'id' => 'JP', 'countryCode' => 81, 'internationalPrefix' => '010', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => true, diff --git a/data/PhoneNumberMetadataForTesting_KR b/data/PhoneNumberMetadataForTesting_KR index 0aedbb7..00cd082 100644 --- a/data/PhoneNumberMetadataForTesting_KR +++ b/data/PhoneNumberMetadataForTesting_KR @@ -45,7 +45,6 @@ return array ( 'id' => 'KR', 'countryCode' => 82, 'internationalPrefix' => '00(?:[124-68]|[37]\\d{2})', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0(8[1-46-8]|85\\d{2})?', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadataForTesting_MX b/data/PhoneNumberMetadataForTesting_MX index 47b904c..f56359d 100644 --- a/data/PhoneNumberMetadataForTesting_MX +++ b/data/PhoneNumberMetadataForTesting_MX @@ -45,7 +45,6 @@ return array ( 'id' => 'MX', 'countryCode' => 52, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '01', 'nationalPrefixForParsing' => '01|04[45](\\d{10})', 'nationalPrefixTransformRule' => '1$1', diff --git a/data/PhoneNumberMetadataForTesting_NZ b/data/PhoneNumberMetadataForTesting_NZ index 9b30203..959ff21 100644 --- a/data/PhoneNumberMetadataForTesting_NZ +++ b/data/PhoneNumberMetadataForTesting_NZ @@ -48,7 +48,6 @@ return array ( 'id' => 'NZ', 'countryCode' => 64, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadataForTesting_PL b/data/PhoneNumberMetadataForTesting_PL index e706613..14a2ee6 100644 --- a/data/PhoneNumberMetadataForTesting_PL +++ b/data/PhoneNumberMetadataForTesting_PL @@ -45,7 +45,6 @@ return array ( 'id' => 'PL', 'countryCode' => 48, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadataForTesting_RE b/data/PhoneNumberMetadataForTesting_RE index 0ee7c48..856d19f 100644 --- a/data/PhoneNumberMetadataForTesting_RE +++ b/data/PhoneNumberMetadataForTesting_RE @@ -45,7 +45,6 @@ return array ( 'id' => 'RE', 'countryCode' => 262, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, diff --git a/data/PhoneNumberMetadataForTesting_SG b/data/PhoneNumberMetadataForTesting_SG index b6c8b70..3543170 100644 --- a/data/PhoneNumberMetadataForTesting_SG +++ b/data/PhoneNumberMetadataForTesting_SG @@ -48,7 +48,6 @@ return array ( 'id' => 'SG', 'countryCode' => 65, 'internationalPrefix' => '0[0-3][0-9]', - 'preferredInternationalPrefix' => '', 'nationalPrefixForParsing' => '777777', 'sameMobileAndFixedLinePattern' => false, 'numberFormat' => diff --git a/data/PhoneNumberMetadataForTesting_US b/data/PhoneNumberMetadataForTesting_US index d20a0ae..e7d5dc0 100644 --- a/data/PhoneNumberMetadataForTesting_US +++ b/data/PhoneNumberMetadataForTesting_US @@ -45,7 +45,6 @@ return array ( 'id' => 'US', 'countryCode' => 1, 'internationalPrefix' => '011', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '1', 'preferredExtnPrefix' => ' extn. ', 'nationalPrefixForParsing' => '1', diff --git a/data/PhoneNumberMetadataForTesting_YT b/data/PhoneNumberMetadataForTesting_YT index 0eb3d22..8216437 100644 --- a/data/PhoneNumberMetadataForTesting_YT +++ b/data/PhoneNumberMetadataForTesting_YT @@ -45,7 +45,6 @@ return array ( 'id' => 'YT', 'countryCode' => 262, 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', 'nationalPrefix' => '0', 'nationalPrefixForParsing' => '0', 'sameMobileAndFixedLinePattern' => false, From f44515d79742f294625f75c294eec30acb803e53 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Fri, 18 May 2012 13:06:45 +0530 Subject: [PATCH 05/13] Removes IN testing phone number metadata and updates test case --- Tests/PhoneNumberUtilTest.php | 4 +- data/PhoneNumberMetadataForTesting_IN | 741 -------------------------- 2 files changed, 2 insertions(+), 743 deletions(-) delete mode 100644 data/PhoneNumberMetadataForTesting_IN diff --git a/Tests/PhoneNumberUtilTest.php b/Tests/PhoneNumberUtilTest.php index 767fcd8..38019ef 100644 --- a/Tests/PhoneNumberUtilTest.php +++ b/Tests/PhoneNumberUtilTest.php @@ -967,8 +967,8 @@ public function testParseNationalNumber() { // Test national number bigger than max 32-bit signed integer $inNumber = new PhoneNumber(); - $inNumber->setCountryCode(91)->setNationalNumber(9876543210); - $this->assertEquals($inNumber, $this->phoneUtil->parse("9876543210", RegionCode::IN)); + $inNumber->setCountryCode(55)->setNationalNumber(9876543210); + $this->assertEquals($inNumber, $this->phoneUtil->parse("9876543210", RegionCode::BR)); } public function testIsAlphaNumber() { diff --git a/data/PhoneNumberMetadataForTesting_IN b/data/PhoneNumberMetadataForTesting_IN deleted file mode 100644 index bb74c76..0000000 --- a/data/PhoneNumberMetadataForTesting_IN +++ /dev/null @@ -1,741 +0,0 @@ - - array ( - 'NationalNumberPattern' => ' - 1\\d{7,12}| - [2-9]\\d{9,10} - ', - 'PossibleNumberPattern' => '\\d{6,13}', - 'ExampleNumber' => '', - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => ' - (?: - 11| - 2[02]| - 33| - 4[04]| - 79 - )[2-6]\\d{7}| - 80[2-46]\\d{7}| - (?: - 1(?: - 2[0-249]| - 3[0-25]| - 4[145]| - [59][14]| - 6[014]| - 7[1257]| - 8[01346] - )| - 2(?: - 1[257]| - 3[013]| - 4[01]| - 5[0137]| - 6[0158]| - 78| - 8[1568]| - 9[14] - )| - 3(?: - 26| - 4[1-3]| - 5[34]| - 6[01489]| - 7[02-46]| - 8[159] - )| - 4(?: - 1[36]| - 2[1-47]| - 3[15]| - 5[12]| - 6[126-9]| - 7[0-24-9]| - 8[013-57]| - 9[014-7] - )| - 5(?: - [136][25]| - 22| - 4[28]| - 5[12]| - [78]1| - 9[15] - )| - 6(?: - 12| - [2345]1| - 57| - 6[13]| - 7[14]| - 80 - )| - 7(?: - 12| - 2[14]| - 3[134]| - 4[47]| - 5[15]| - [67]1| - 88 - )| - 8(?: - 16| - 2[014]| - 3[126]| - 6[136]| - 7[078]| - 8[34]| - 91 - ) - )[2-6]\\d{6}| - (?: - (?: - 1(?: - 2[35-8]| - 3[346-9]| - 4[236-9]| - [59][0235-9]| - 6[235-9]| - 7[34689]| - 8[257-9] - )| - 2(?: - 1[134689]| - 3[24-8]| - 4[2-8]| - 5[25689]| - 6[2-4679]| - 7[13-79]| - 8[2-479]| - 9[235-9] - )| - 3(?: - 01| - 1[79]| - 2[1-5]| - 4[25-8]| - 5[125689]| - 6[235-7]| - 7[157-9]| - 8[2-467] - )| - 4(?: - 1[14578]| - 2[5689]| - 3[2-467]| - 5[4-7]| - 6[35]| - 73| - 8[2689]| - 9[2389] - )| - 5(?: - [16][146-9]| - 2[14-8]| - 3[1346]| - 4[14-69]| - 5[46]| - 7[2-4]| - 8[2-8]| - 9[246] - )| - 6(?: - 1[1358]| - 2[2457]| - 3[2-4]| - 4[235-7]| - 5[2-689]| - 6[24-58]| - 7[23-689]| - 8[1-6] - )| - 8(?: - 1[1357-9]| - 2[235-8]| - 3[03-57-9]| - 4[0-24-9]| - 5\\d| - 6[2457-9]| - 7[1-6]| - 8[1256]| - 9[2-4] - ) - )\\d| - 7(?: - (?: - 1[013-9]| - 2[0235-9]| - 3[2679]| - 4[1-35689]| - 5[2-46-9]| - [67][02-9]| - 9\\d - )\\d| - 8(?: - 2[0-6]| - [013-8]\\d - ) - ) - )[2-6]\\d{5} - ', - 'PossibleNumberPattern' => '\\d{6,10}', - 'ExampleNumber' => '1123456789', - ), - 'mobile' => - array ( - 'NationalNumberPattern' => ' - (?: - 7(?: - 2(?: - 0[04-9]| - 5[09]| - 7[5-8]| - 9[389] - )| - 3(?: - 0[13-9]| - 5[0-4789]| - 7[3679]| - 8[1-9]| - 9[689] - )| - 4(?: - 0[1245789]| - 1[15-9]| - [29][89]| - 39| - 8[389] - )| - 5(?: - 0[0-5789]| - [47]9| - [25]0| - 6[6-9]| - [89][7-9] - )| - 6(?: - 0[027]| - 12| - 20| - 3[19]| - 5[45]| - 6[5-9]| - 7[679]| - 9[6-9] - )| - 7(?: - 0[27-9]| - [39][5-9]| - 42| - 60 - )| - 8(?: - [03][07-9]| - 14| - 2[7-9]| - 4[25]| - 6[09]| - 7\\d| - 9[013-9] - ) - )| - 8(?: - 0(?: - [01589]\\d| - 66 - )| - 1(?: - [024]\\d| - 1[56]| - 30| - 7[19]| - 97 - )| - 2(?: - [2369]\\d| - 52| - 7[01357]| - 8[567] - )| - 3(?: - 0[0235-8]| - 4[14789]| - 74| - 90 - )| - 4(?: - [02-58]\\d| - 10| - 6[09] - )| - 5(?: - 0[079]| - 11| - 2\\d| - 30| - 4[47]| - 53| - 7[45]| - 85| - 9[015] - )| - 6(?: - [0589]\\d| - 7[09] - )| - 7(?: - 1[24]| - 33| - [2569]\\d - )| - 8(?: - [07-9]\\d| - 17| - 2[024-8]| - 44| - 5[3589]| - 6[0167] - )| - 9(?: - [057-9]\\d| - 2[35-9]| - 3[019]| - 4[036-8]| - 6[0-46-9] - ) - )| - 9\\d{3} - )\\d{6} - ', - 'PossibleNumberPattern' => '\\d{10}', - 'ExampleNumber' => '9123456789', - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => ' - 1(?: - 600\\d{6}| - 80(?: - 0\\d{4,8}| - 3\\d{9} - ) - ) - ', - 'PossibleNumberPattern' => '\\d{8,13}', - 'ExampleNumber' => '1800123456', - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '186[12]\\d{9}', - 'PossibleNumberPattern' => '\\d{13}', - 'ExampleNumber' => '1861123456789', - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => 'NA', - 'PossibleNumberPattern' => 'NA', - 'ExampleNumber' => '', - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => ' - 1(?: - 600\\d{6}| - 8(?: - 0(?: - 0\\d{4,8}| - 3\\d{9} - )| - 6(?: - 0\\d{7}| - [12]\\d{9} - ) - ) - ) - ', - 'PossibleNumberPattern' => '\\d{8,13}', - 'ExampleNumber' => '1800123456', - ), - 'id' => 'IN', - 'countryCode' => 91, - 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{6})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => ' - 7(?: - 2[0579]| - 3[057-9]| - 4[0-389]| - 5[024-9]| - 6[0-35-9]| - 7[03469]| - 8[0-4679] - )| - 8(?: - 0[01589]| - 1[0-479]| - 2[236-9]| - 3[0479]| - 4[0-68]| - 5[0-57-9] - 6[05789] - 7[123569]| - 8[0124-9]| - 9[02-9] - )| - 9 - ', - 1 => ' - 7(?: - 2(?: - 0[04-9]| - 5[09]| - 7[5-8]| - 9[389] - )| - 3(?: - 0[13-9]| - 5[0-4789]| - 7[3679]| - 8[1-9]| - 9[689] - )| - 4(?: - 0[1245789]| - 1[15-9]| - [29][89]| - 39| - 8[389] - )| - 5(?: - 0[0-5789]| - [47]9| - [25]0| - 6[6-9]| - [89][7-9] - )| - 6(?: - 0[027]| - 12| - 20| - 3[19]| - 5[45]| - 6[5-9]| - 7[679]| - 9[6-9] - )| - 7(?: - 0[27-9]| - 3[5-9]| - 42| - 60| - 9[5-9] - )| - 8(?: - [03][07-9]| - 14| - 2[7-9]| - 4[25]| - 6[09]| - 7| - 9[013-9] - ) - )| - 8(?: - 0[01589]| - 1(?: - [024]| - 1[56]| - 30| - 7[19]| - 97 - )| - 2(?: - [2369]| - 7[01357]| - 8[567] - )| - 3(?: - 0[0235-8]| - 4[14789]| - 74| - 90 - )| - 4(?: - [02-58]| - 10| - 6[09] - )| - 5(?: - 0[079]| - 11| - 2| - 30| - 4[47]| - 53| - 85| - 7[45]| - 9[015] - )| - 6(?: - [0589]| - 70 - )| - 7(?: - 1[24]| - 33| - [2569] - )| - 8(?: - [07-9]| - 17| - 2[024-8]| - 44| - 5[3589]| - 6[0167] - )| - 9(?: - [057-9]| - 2[35-9]| - 3[019]| - 4[03678]| - 6[0-46-9] - ) - )| - 9 - ', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => ' - 11| - 2[02]| - 33| - 4[04]| - 79| - 80[2-46] - ', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => ' - 1(?: - 2[0-249]| - 3[0-25]| - 4[145]| - [569][14]| - 7[1257]| - 8[1346]| - [68][1-9] - )| - 2(?: - 1[257]| - 3[013]| - 4[01]| - 5[0137]| - 6[0158]| - 78| - 8[1568]| - 9[14] - )| - 3(?: - 26| - 4[1-3]| - 5[34]| - 6[01489]| - 7[02-46]| - 8[159] - )| - 4(?: - 1[36]| - 2[1-47]| - 3[15]| - 5[12]| - 6[126-9]| - 7[0-24-9]| - 8[013-57]| - 9[014-7] - )| - 5(?: - [136][25]| - 22| - 4[28]| - 5[12]| - [78]1| - 9[15] - )| - 6(?: - 12| - [2345]1| - 57| - 6[13]| - 7[14]| - 80 - ) - ', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => ' - 7(?: - 12| - 2[14]| - 3[134]| - 4[47]| - 5[15]| - [67]1| - 88 - ) - ', - 1 => ' - 7(?: - 12| - 2[14]| - 3[134]| - 4[47]| - 5(?: - 1| - 5[2-6] - )| - [67]1| - 88 - ) - ', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => ' - 8(?: - 16| - 2[014]| - 3[126]| - 6[136]| - 7[078]| - 8[34]| - 91 - ) - ', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 5 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => ' - 1(?: - [2-579]| - [68][1-9] - )| - [2-8] - ', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 6 => - array ( - 'pattern' => '(1600)(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '160', - 1 => '1600', - ), - 'nationalPrefixFormattingRule' => '$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 7 => - array ( - 'pattern' => '(1800)(\\d{4,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '180', - 1 => '1800', - ), - 'nationalPrefixFormattingRule' => '$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 8 => - array ( - 'pattern' => '(18[06]0)(\\d{2,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '18[06]', - 1 => '18[06]0', - ), - 'nationalPrefixFormattingRule' => '$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 9 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '18[06]', - 1 => ' - 18(?: - 03| - 6[12] - ) - ', - ), - 'nationalPrefixFormattingRule' => '$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => NULL, - 'leadingZeroPossible' => NULL, -); \ No newline at end of file From f673f98139c922e231074238ed82314b5956b351 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Sat, 19 May 2012 18:36:17 +0530 Subject: [PATCH 06/13] Updates MetaData on Phone Number Plan & formatting rules from GoogleCode --- data/PhoneNumberMetadata_878 | 67 ++++++++++++++++++++++++++++++++++++ data/PhoneNumberMetadata_BH | 1 + data/PhoneNumberMetadata_EE | 10 ++++-- data/PhoneNumberMetadata_JO | 1 - data/PhoneNumberMetadata_KW | 2 +- data/PhoneNumberMetadata_LA | 2 +- data/PhoneNumberMetadata_QA | 2 +- data/PhoneNumberMetadata_SI | 6 ++-- data/PhoneNumberMetadata_TH | 15 ++------ 9 files changed, 83 insertions(+), 23 deletions(-) create mode 100644 data/PhoneNumberMetadata_878 diff --git a/data/PhoneNumberMetadata_878 b/data/PhoneNumberMetadata_878 new file mode 100644 index 0000000..41f358d --- /dev/null +++ b/data/PhoneNumberMetadata_878 @@ -0,0 +1,67 @@ + + array ( + 'NationalNumberPattern' => '1\\d{11}', + 'PossibleNumberPattern' => '\\d{12}', + 'ExampleNumber' => '101234567890', + ), + 'fixedLine' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '101234567890', + ), + 'mobile' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '101234567890', + ), + 'tollFree' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '', + ), + 'premiumRate' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '', + ), + 'sharedCost' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '', + ), + 'noInternationalDialling' => + array ( + 'NationalNumberPattern' => 'NA', + 'PossibleNumberPattern' => 'NA', + 'ExampleNumber' => '', + ), + 'id' => '001', + 'countryCode' => 878, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => + array ( + 0 => + array ( + 'pattern' => '(\\d{2})(\\d{5})(\\d{5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => + array ( + ), + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + ), + ), + 'intlNumberFormat' => + array ( + ), + 'mainCountryForCode' => NULL, + 'leadingZeroPossible' => NULL, +); \ No newline at end of file diff --git a/data/PhoneNumberMetadata_BH b/data/PhoneNumberMetadata_BH index ad75e48..c87188a 100644 --- a/data/PhoneNumberMetadata_BH +++ b/data/PhoneNumberMetadata_BH @@ -39,6 +39,7 @@ return array ( (?: 3(?: [23469]\\d| + 5[35]| 77| 8[348] )\\d| diff --git a/data/PhoneNumberMetadata_EE b/data/PhoneNumberMetadata_EE index e5ca035..ca52018 100644 --- a/data/PhoneNumberMetadata_EE +++ b/data/PhoneNumberMetadata_EE @@ -3,10 +3,11 @@ return array ( 'generalDesc' => array ( 'NationalNumberPattern' => ' + 1\\d{3,4}| [3-9]\\d{6,7}| 800\\d{6,7} ', - 'PossibleNumberPattern' => '\\d{7,10}', + 'PossibleNumberPattern' => '\\d{4,10}', 'ExampleNumber' => '', ), 'fixedLine' => @@ -73,8 +74,11 @@ return array ( ), 'noInternationalDialling' => array ( - 'NationalNumberPattern' => '800[2-9]\\d{3}', - 'PossibleNumberPattern' => '\\d{7}', + 'NationalNumberPattern' => ' + 1\\d{3,4}| + 800[2-9]\\d{3} + ', + 'PossibleNumberPattern' => '\\d{4,7}', 'ExampleNumber' => '8002123', ), 'id' => 'EE', diff --git a/data/PhoneNumberMetadata_JO b/data/PhoneNumberMetadata_JO index abdd27c..551a335 100644 --- a/data/PhoneNumberMetadata_JO +++ b/data/PhoneNumberMetadata_JO @@ -84,7 +84,6 @@ return array ( array ( 'NationalNumberPattern' => ' 7(?: - 45| 5\\d| 7[2-79]| 8[5-8]| diff --git a/data/PhoneNumberMetadata_KW b/data/PhoneNumberMetadata_KW index 5ea2b1c..51b9acf 100644 --- a/data/PhoneNumberMetadata_KW +++ b/data/PhoneNumberMetadata_KW @@ -53,7 +53,7 @@ return array ( 9(?: 0[09]| 4[049]| - 66| + 6[69]| [79]\\d ) )\\d{5} diff --git a/data/PhoneNumberMetadata_LA b/data/PhoneNumberMetadata_LA index a3a1d7c..22deaaf 100644 --- a/data/PhoneNumberMetadata_LA +++ b/data/PhoneNumberMetadata_LA @@ -23,7 +23,7 @@ return array ( array ( 'NationalNumberPattern' => ' 20(?: - 2[23]| + 2[238]| 5[4-68]| 7[78]| 9[7-9] diff --git a/data/PhoneNumberMetadata_QA b/data/PhoneNumberMetadata_QA index 1d19b44..fd35b46 100644 --- a/data/PhoneNumberMetadata_QA +++ b/data/PhoneNumberMetadata_QA @@ -8,7 +8,7 @@ return array ( ), 'fixedLine' => array ( - 'NationalNumberPattern' => '44\\d{6}', + 'NationalNumberPattern' => '4[04]\\d{6}', 'PossibleNumberPattern' => '\\d{7,8}', 'ExampleNumber' => '44123456', ), diff --git a/data/PhoneNumberMetadata_SI b/data/PhoneNumberMetadata_SI index a9bb640..5e06141 100644 --- a/data/PhoneNumberMetadata_SI +++ b/data/PhoneNumberMetadata_SI @@ -14,10 +14,10 @@ return array ( 'NationalNumberPattern' => ' (?: 1\\d| - 2[2-8]| + [25][2-8]| 3[4-8]| 4[24-8]| - [57][3-8] + 7[3-8] )\\d{6} ', 'PossibleNumberPattern' => '\\d{7,8}', @@ -81,7 +81,7 @@ return array ( [12]| 3[4-8]| 4[24-8]| - 5[3-8]| + 5[2-8]| 7[3-8] ', ), diff --git a/data/PhoneNumberMetadata_TH b/data/PhoneNumberMetadata_TH index 0576f67..4548eee 100644 --- a/data/PhoneNumberMetadata_TH +++ b/data/PhoneNumberMetadata_TH @@ -74,27 +74,16 @@ return array ( ), 1 => array ( - 'pattern' => '([3-7]\\d)(\\d{3})(\\d{3,4})', + 'pattern' => '([3-9]\\d)(\\d{3})(\\d{3,4})', 'format' => '$1 $2 $3', 'leadingDigitsPatterns' => array ( - 0 => '[3-7]', + 0 => '[3-9]', ), 'nationalPrefixFormattingRule' => '0$1', 'domesticCarrierCodeFormattingRule' => '', ), 2 => - array ( - 'pattern' => '([89])(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - ), - 3 => array ( 'pattern' => '(1[89]00)(\\d{3})(\\d{3})', 'format' => '$1 $2 $3', From 75cf006a22b3965f7427bb40f5931fa6d38ca3b6 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Sat, 19 May 2012 22:02:19 +0530 Subject: [PATCH 07/13] Changes keepRawInput to true in PhoneNumberUtil::parse --- PhoneNumberUtil.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhoneNumberUtil.php b/PhoneNumberUtil.php index 5a9bf32..88d9fba 100644 --- a/PhoneNumberUtil.php +++ b/PhoneNumberUtil.php @@ -1115,7 +1115,7 @@ public function parse($numberToParse, $defaultRegion, PhoneNumber $phoneNumber if ($phoneNumber === NULL) { $phoneNumber = new PhoneNumber(); } - $this->parseHelper($numberToParse, $defaultRegion, false, true, $phoneNumber); + $this->parseHelper($numberToParse, $defaultRegion, true, true, $phoneNumber); return $phoneNumber; } From f264abae6cf97a73d9f015585d1734343f0e1475 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Sat, 19 May 2012 22:07:31 +0530 Subject: [PATCH 08/13] Changes namespace & updates classes/comments/tests accordingly * Updates namespace from com\google\i18n\phonenumbers to libphonenumber * Updates comments & README for namespace change * Moves multiple classes in single file to individual classes * Adds use & require_once statements in tests, build & demo.php accordingly --- CountryCodeSource.php | 14 ++ CountryCodeToRegionCodeMap.php | 2 +- CountryCodeToRegionCodeMapForTesting.php | 2 +- MatchType.php | 16 ++ Matcher.php | 121 +++++++++++ NumberFormat.php | 261 ++++++++++++++++++++++ NumberParseException.php | 2 +- PhoneMetadata.php | 265 +---------------------- PhoneNumber.php | 10 +- PhoneNumberDesc.php | 167 ++++++++++++++ PhoneNumberFormat.php | 22 ++ PhoneNumberType.php | 35 +++ PhoneNumberUtil.php | 174 +-------------- README.md | 12 +- RegionCode.php | 2 +- Tests/PhoneNumberUtilTest.php | 29 ++- ValidationResult.php | 14 ++ build/BuildMetadataFromXml.php | 10 +- build/BuildMetadataPHPFromXml.php | 2 +- demo.php | 14 +- 20 files changed, 713 insertions(+), 461 deletions(-) create mode 100644 CountryCodeSource.php create mode 100644 MatchType.php create mode 100644 Matcher.php create mode 100644 NumberFormat.php create mode 100644 PhoneNumberDesc.php create mode 100644 PhoneNumberFormat.php create mode 100644 PhoneNumberType.php create mode 100644 ValidationResult.php diff --git a/CountryCodeSource.php b/CountryCodeSource.php new file mode 100644 index 0000000..15a529d --- /dev/null +++ b/CountryCodeSource.php @@ -0,0 +1,14 @@ +pattern = $pattern; + $this->subject = $subject; + } + + /** + * @return bool + */ + public function matches() + { + return preg_match('/^(?:' . str_replace('/', '\/', $this->pattern) . ')$/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0; + } + + /** + * @return bool + */ + public function lookingAt() + { + $this->fullPatternMatchesNumber = preg_match_all('/^(?:' . str_replace('/', '\/', $this->pattern) . ')/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE); + + return $this->fullPatternMatchesNumber > 0; + } + + /** + * @return bool + */ + public function find() + { + return preg_match('/(?:' . str_replace('/', '\/', $this->pattern) . ')/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0; + } + + + /** + * @return int + */ + public function groupCount() + { + return count($this->groups); + } + + /** + * @param int $group + * + * @return string + */ + public function group($group = null) + { + return $this->groups[$group - 1][0]; + } + + /** + * @return int + */ + public function end() + { + $lastGroup = $this->groups[$this->fullPatternMatchesNumber - 1][0]; + + return $lastGroup[1] + strlen($lastGroup[0]); + } + + /** + * @param string $replacement + * + * @return string + */ + public function replaceFirst($replacement) + { + return preg_replace('/' . str_replace('/', '\/', $this->pattern) . '/', $replacement, $this->subject, 1); + } + + /** + * @param string $replacement + * + * @return string + */ + public function replaceAll($replacement) + { + return preg_replace('/' . str_replace('/', '\/', $this->pattern) . '/', $replacement, $this->subject); + } + + /** + * @param string $input + * + * @return Matcher + */ + public function reset($input = "") + { + $this->subject = $input; + + return $this; + } +} diff --git a/NumberFormat.php b/NumberFormat.php new file mode 100644 index 0000000..bb76d2c --- /dev/null +++ b/NumberFormat.php @@ -0,0 +1,261 @@ +pattern); + } + + /** + * @return string + */ + public function getPattern() + { + return $this->pattern; + } + + /** + * @param string $value + * + * @return NumberFormat + */ + public function setPattern($value) + { + $this->pattern = $value; + + return $this; + } + + /** + * @return boolean + */ + public function hasFormat() + { + return isset($this->format); + } + + /** + * @return string + */ + public function getFormat() + { + return $this->format; + } + + /** + * @param string $value + * + * @return NumberFormat + */ + public function setFormat($value) + { + $this->format = $value; + + return $this; + } + + /** + * @return string + */ + public function leadingDigitPatterns() + { + return $this->leadingDigitsPattern; + } + + /** + * @return int + */ + public function leadingDigitsPatternSize() + { + return count($this->leadingDigitsPattern); + } + + /** + * @param int $index + * + * @return string + */ + public function getLeadingDigitsPattern($index) + { + return $this->leadingDigitsPattern[$index]; + } + + /** + * @param string $value + * + * @return NumberFormat + */ + public function addLeadingDigitsPattern($value) + { + $this->leadingDigitsPattern[] = $value; + + return $this; + } + + /** + * @return boolen + */ + public function hasNationalPrefixFormattingRule() + { + return isset($this->nationalPrefixFormattingRule); + } + + /** + * @return string + */ + public function getNationalPrefixFormattingRule() + { + return $this->nationalPrefixFormattingRule; + } + + /** + * @param string $value + * + * @return NumberFormat + */ + public function setNationalPrefixFormattingRule($value) + { + $this->nationalPrefixFormattingRule = $value; + + return $this; + } + + /** + * @return NumberFormat + */ + public function clearNationalPrefixFormattingRule() + { + $this->nationalPrefixFormattingRule = null; + + return $this; + } + + /* + // optional bool national_prefix_optional_when_formatting = 6; + private boolean hasNationalPrefixOptionalWhenFormatting; + private boolean nationalPrefixOptionalWhenFormatting_ = false; + public boolean hasNationalPrefixOptionalWhenFormatting() { + return hasNationalPrefixOptionalWhenFormatting; } + public boolean isNationalPrefixOptionalWhenFormatting() { + return nationalPrefixOptionalWhenFormatting_; } + public NumberFormat setNationalPrefixOptionalWhenFormatting(boolean value) { + hasNationalPrefixOptionalWhenFormatting = true; + nationalPrefixOptionalWhenFormatting_ = value; + return this; + } + */ + + /** + * @return boolean + */ + public function hasDomesticCarrierCodeFormattingRule() + { + return isset($this->domesticCarrierCodeFormattingRule); + } + + /** + * @return string + */ + public function getDomesticCarrierCodeFormattingRule() + { + return $this->domesticCarrierCodeFormattingRule; + } + + /** + * @param string $value + * + * @return NumberFormat + */ + public function setDomesticCarrierCodeFormattingRule($value) + { + $this->domesticCarrierCodeFormattingRule = $value; + + return $this; + } + + /** + * @param NumberFormat $other + * + * @return NumberFormat + */ + public function mergeFrom(NumberFormat $other) + { + if ($other->hasPattern()) { + $this->setPattern($other->getPattern()); + } + if ($other->hasFormat()) { + $this->setFormat($other->getFormat()); + } + $leadingDigitsPatternSize = $other->leadingDigitsPatternSize(); + for ($i = 0; $i < $leadingDigitsPatternSize; $i++) { + $this->addLeadingDigitsPattern($other->getLeadingDigitsPattern($i)); + } + if ($other->hasNationalPrefixFormattingRule()) { + $this->setNationalPrefixFormattingRule($other->getNationalPrefixFormattingRule()); + } + if ($other->hasDomesticCarrierCodeFormattingRule()) { + $this->setDomesticCarrierCodeFormattingRule($other->getDomesticCarrierCodeFormattingRule()); + } + // $this->setNationalPrefixOptionalWhenFormatting($other->isNationalPrefixOptionalWhenFormatting()); + + return $this; + } + + /** + * @return array + */ + public function toArray() + { + $output = array(); + $output['pattern'] = $this->getPattern(); + $output['format'] = $this->getFormat(); + + $output['leadingDigitsPatterns'] = $this->leadingDigitPatterns(); + + if ($this->hasNationalPrefixFormattingRule()) { + $output['nationalPrefixFormattingRule'] = $this->getNationalPrefixFormattingRule(); + } + + if ($this->hasDomesticCarrierCodeFormattingRule()) { + $output['domesticCarrierCodeFormattingRule'] = $this->getDomesticCarrierCodeFormattingRule(); + } + //objectOutput.writeBoolean(nationalPrefixOptionalWhenFormatting_); + + return $output; + } + + /** + * @param array $input + */ + public function fromArray(array $input) + { + $this->setPattern($input['pattern']); + $this->setFormat($input['format']); + foreach ($input['leadingDigitsPatterns'] as $leadingDigitsPattern) { + $this->addLeadingDigitsPattern($leadingDigitsPattern); + } + + if (isset($input['nationalPrefixFormattingRule'])) { + $this->setNationalPrefixFormattingRule($input['nationalPrefixFormattingRule']); + } + if (isset($input['domesticCarrierCodeFormattingRule'])) { + $this->setDomesticCarrierCodeFormattingRule($input['domesticCarrierCodeFormattingRule']); + } + //setNationalPrefixOptionalWhenFormatting(objectInput.readBoolean()); + } +} diff --git a/NumberParseException.php b/NumberParseException.php index 9fbf27e..6ca763a 100644 --- a/NumberParseException.php +++ b/NumberParseException.php @@ -1,6 +1,6 @@ hasNationalNumberPattern; - } - - public function getNationalNumberPattern() { - return $this->nationalNumberPattern_; - } - - public function setNationalNumberPattern($value) { - $this->hasNationalNumberPattern = true; - $this->nationalNumberPattern_ = $value; - return $this; - } - - private $hasPossibleNumberPattern; - private $possibleNumberPattern_ = ""; - - public function hasPossibleNumberPattern() { - return $this->hasPossibleNumberPattern; - } - - public function getPossibleNumberPattern() { - return $this->possibleNumberPattern_; - } - - public function setPossibleNumberPattern($value) { - $this->hasPossibleNumberPattern = true; - $this->possibleNumberPattern_ = $value; - return $this; - } - - private $hasExampleNumber; - private $exampleNumber_ = ""; - - public function hasExampleNumber() { - return $this->hasExampleNumber; - } - - public function getExampleNumber() { - return $this->exampleNumber_; - } - - public function setExampleNumber($value) { - $this->hasExampleNumber = true; - $this->exampleNumber_ = $value; - return $this; - } - - public function mergeFrom(PhoneNumberDesc $other) { - if ($other->hasNationalNumberPattern()) { - $this->setNationalNumberPattern($other->getNationalNumberPattern()); - } - if ($other->hasPossibleNumberPattern()) { - $this->setPossibleNumberPattern($other->getPossibleNumberPattern()); - } - if ($other->hasExampleNumber()) { - $this->setExampleNumber($other->getExampleNumber()); - } - return $this; - } - - public function exactlySameAs(PhoneNumberDesc $other) { - return $this->nationalNumberPattern_ === $other->nationalNumberPattern_ && - $this->possibleNumberPattern_ === $other->possibleNumberPattern_ && - $this->exampleNumber_ === $other->exampleNumber_; - } - - public function toArray() { - return array( - 'NationalNumberPattern' => $this->getNationalNumberPattern(), - 'PossibleNumberPattern' => $this->getPossibleNumberPattern(), - 'ExampleNumber' => $this->getExampleNumber(), - ); - } - - public function fromArray(array $input) { - if (isset($input['NationalNumberPattern'])) { - $this->setNationalNumberPattern($input['NationalNumberPattern']); - } - if (isset($input['PossibleNumberPattern'])) { - $this->setPossibleNumberPattern($input['PossibleNumberPattern']); - } - if (isset($input['ExampleNumber'])) { - $this->setExampleNumber($input['ExampleNumber']); - } - return $this; - } - -} - -class NumberFormat { - - private $pattern = NULL; - - public function hasPattern() { - return isset($this->pattern); - } - - public function getPattern() { - return $this->pattern; - } - - public function setPattern($value) { - $this->pattern = $value; - return $this; - } - - private $format = NULL; - - public function hasFormat() { - return isset($this->format); - } - - public function getFormat() { - return $this->format; - } - - public function setFormat($value) { - $this->format = $value; - return $this; - } - - private $leadingDigitsPattern = array(); - - public function leadingDigitPatterns() { - return $this->leadingDigitsPattern; - } - - public function leadingDigitsPatternSize() { - return count($this->leadingDigitsPattern); - } - - public function getLeadingDigitsPattern($index) { - return $this->leadingDigitsPattern[$index]; - } - - public function addLeadingDigitsPattern($value) { - $this->leadingDigitsPattern[] = $value; - return $this; - } - - private $nationalPrefixFormattingRule = NULL; - - public function hasNationalPrefixFormattingRule() { - return isset($this->nationalPrefixFormattingRule); - } - - public function getNationalPrefixFormattingRule() { - return $this->nationalPrefixFormattingRule; - } - - public function setNationalPrefixFormattingRule($value) { - $this->nationalPrefixFormattingRule = $value; - return $this; - } - - public function clearNationalPrefixFormattingRule() { - $this->nationalPrefixFormattingRule = NULL; - return $this; - } - - /* - // optional bool national_prefix_optional_when_formatting = 6; - private boolean hasNationalPrefixOptionalWhenFormatting; - private boolean nationalPrefixOptionalWhenFormatting_ = false; - public boolean hasNationalPrefixOptionalWhenFormatting() { - return hasNationalPrefixOptionalWhenFormatting; } - public boolean isNationalPrefixOptionalWhenFormatting() { - return nationalPrefixOptionalWhenFormatting_; } - public NumberFormat setNationalPrefixOptionalWhenFormatting(boolean value) { - hasNationalPrefixOptionalWhenFormatting = true; - nationalPrefixOptionalWhenFormatting_ = value; - return this; - } - */ - - private $domesticCarrierCodeFormattingRule = NULL; - - public function hasDomesticCarrierCodeFormattingRule() { - return isset($this->domesticCarrierCodeFormattingRule); - } - - public function getDomesticCarrierCodeFormattingRule() { - return $this->domesticCarrierCodeFormattingRule; - } - - public function setDomesticCarrierCodeFormattingRule($value) { - $this->domesticCarrierCodeFormattingRule = $value; - return $this; - } - - /** - * @param NumberFormat $other - * @return NumberFormat - */ - public function mergeFrom(NumberFormat $other) { - if ($other->hasPattern()) { - $this->setPattern($other->getPattern()); - } - if ($other->hasFormat()) { - $this->setFormat($other->getFormat()); - } - $leadingDigitsPatternSize = $other->leadingDigitsPatternSize(); - for ($i = 0; $i < $leadingDigitsPatternSize; $i++) { - $this->addLeadingDigitsPattern($other->getLeadingDigitsPattern($i)); - } - if ($other->hasNationalPrefixFormattingRule()) { - $this->setNationalPrefixFormattingRule($other->getNationalPrefixFormattingRule()); - } - if ($other->hasDomesticCarrierCodeFormattingRule()) { - $this->setDomesticCarrierCodeFormattingRule($other->getDomesticCarrierCodeFormattingRule()); - } - // $this->setNationalPrefixOptionalWhenFormatting($other->isNationalPrefixOptionalWhenFormatting()); - return $this; - } - - public function toArray() { - $output = array(); - $output['pattern'] = $this->getPattern(); - $output['format'] = $this->getFormat(); - - $output['leadingDigitsPatterns'] = $this->leadingDigitPatterns(); - - if ($this->hasNationalPrefixFormattingRule()) { - $output['nationalPrefixFormattingRule'] = $this->getNationalPrefixFormattingRule(); - } - - if ($this->hasDomesticCarrierCodeFormattingRule()) { - $output['domesticCarrierCodeFormattingRule'] = $this->getDomesticCarrierCodeFormattingRule(); - } - - /* - objectOutput.writeBoolean(nationalPrefixOptionalWhenFormatting_); - */ - return $output; - } - - public function fromArray(array $input) { - $this->setPattern($input['pattern']); - $this->setFormat($input['format']); - foreach ($input['leadingDigitsPatterns'] as $leadingDigitsPattern) { - $this->addLeadingDigitsPattern($leadingDigitsPattern); - } - - if (isset($input['nationalPrefixFormattingRule'])) { - $this->setNationalPrefixFormattingRule($input['nationalPrefixFormattingRule']); - } - if (isset($input['domesticCarrierCodeFormattingRule'])) { - $this->setDomesticCarrierCodeFormattingRule($input['domesticCarrierCodeFormattingRule']); - } - /* - setNationalPrefixOptionalWhenFormatting(objectInput.readBoolean()); - * - */ - } - -} \ No newline at end of file diff --git a/PhoneNumber.php b/PhoneNumber.php index b50a826..f5b6ebb 100644 --- a/PhoneNumber.php +++ b/PhoneNumber.php @@ -1,6 +1,6 @@ hasNationalNumberPattern; + } + + /** + * @return string + */ + public function getNationalNumberPattern() + { + return $this->nationalNumberPattern; + } + + /** + * @param string $value + * + * @return PhoneNumberDesc + */ + public function setNationalNumberPattern($value) + { + $this->hasNationalNumberPattern = true; + $this->nationalNumberPattern = $value; + + return $this; + } + + /** + * @return boolean + */ + public function hasPossibleNumberPattern() + { + return $this->hasPossibleNumberPattern; + } + + /** + * @return string + */ + public function getPossibleNumberPattern() + { + return $this->possibleNumberPattern; + } + + /** + * @param string $value + * + * @return PhoneNumberDesc + */ + public function setPossibleNumberPattern($value) + { + $this->hasPossibleNumberPattern = true; + $this->possibleNumberPattern = $value; + + return $this; + } + + /** + * @return string + */ + public function hasExampleNumber() + { + return $this->hasExampleNumber; + } + + /** + * @return string + */ + public function getExampleNumber() + { + return $this->exampleNumber; + } + + /** + * @param string $value + * + * @return PhoneNumberDesc + */ + public function setExampleNumber($value) + { + $this->hasExampleNumber = true; + $this->exampleNumber = $value; + + return $this; + } + + /** + * @param PhoneNumberDesc $other + * + * @return PhoneNumberDesc + */ + public function mergeFrom(PhoneNumberDesc $other) + { + if ($other->hasNationalNumberPattern()) { + $this->setNationalNumberPattern($other->getNationalNumberPattern()); + } + if ($other->hasPossibleNumberPattern()) { + $this->setPossibleNumberPattern($other->getPossibleNumberPattern()); + } + if ($other->hasExampleNumber()) { + $this->setExampleNumber($other->getExampleNumber()); + } + + return $this; + } + + /** + * @param PhoneNumberDesc $other + * + * @return boolean + */ + public function exactlySameAs(PhoneNumberDesc $other) + { + return $this->nationalNumberPattern === $other->nationalNumberPattern && + $this->possibleNumberPattern === $other->possibleNumberPattern && + $this->exampleNumber === $other->exampleNumber; + } + + /** + * @return array + */ + public function toArray() + { + return array( + 'NationalNumberPattern' => $this->getNationalNumberPattern(), + 'PossibleNumberPattern' => $this->getPossibleNumberPattern(), + 'ExampleNumber' => $this->getExampleNumber(), + ); + } + + /** + * @param array $input + * + * @return PhoneNumberDesc + */ + public function fromArray(array $input) + { + if (isset($input['NationalNumberPattern'])) { + $this->setNationalNumberPattern($input['NationalNumberPattern']); + } + if (isset($input['PossibleNumberPattern'])) { + $this->setPossibleNumberPattern($input['PossibleNumberPattern']); + } + if (isset($input['ExampleNumber'])) { + $this->setExampleNumber($input['ExampleNumber']); + } + + return $this; + } +} diff --git a/PhoneNumberFormat.php b/PhoneNumberFormat.php new file mode 100644 index 0000000..28490c7 --- /dev/null +++ b/PhoneNumberFormat.php @@ -0,0 +1,22 @@ + some geographical numbers have no area codes. * - * @param \com\google\i18n\phonenumbers\PhoneNumber $number PhoneNumber object for which clients want to know the length of the area code. + * @param \libphonenumber\PhoneNumber $number PhoneNumber object for which clients want to know the length of the area code. * @return int the length of area code of the PhoneNumber object passed in. */ public function getLengthOfGeographicalAreaCode(PhoneNumber $number) { @@ -660,7 +578,7 @@ public function getLengthOfGeographicalAreaCode(PhoneNumber $number) { * Refer to the unittests to see the difference between this function and * {@link #getLengthOfGeographicalAreaCode}. * - * @param \com\google\i18n\phonenumbers\PhoneNumber $number the PhoneNumber object for which clients want to know the length of the NDC. + * @param \libphonenumber\PhoneNumber $number the PhoneNumber object for which clients want to know the length of the NDC. * @return int the length of NDC of the PhoneNumber object passed in. */ public function getLengthOfNationalDestinationCode(PhoneNumber $number) { @@ -1931,7 +1849,7 @@ private function getRegionCodeForNumberFromRegionList(PhoneNumber $number, array * Gets the national significant number of the a phone number. Note a national significant number * doesn't contain a national prefix or any formatting. * - * @param \com\google\i18n\phonenumbers\PhoneNumber $number the phone number for which the national significant number is needed + * @param \libphonenumber\PhoneNumber $number the phone number for which the national significant number is needed * @return string the national significant number of the PhoneNumber object passed in */ public function getNationalSignificantNumber(PhoneNumber $number) { @@ -2154,7 +2072,7 @@ private function getNumberDescByType(PhoneMetadata $metadata, $type) { $metadata = $this->getMetadataForRegionOrCallingCode($number->getCountryCode(), $regionCode); return $this->getNumberTypeHelper($nationalSignificantNumber, $metadata); } - * @param \com\google\i18n\phonenumbers\PhoneNumber $number the number the phone number that we want to know the type + * @param \libphonenumber\PhoneNumber $number the number the phone number that we want to know the type * @return PhoneNumberType the type of the phone number */ public function getNumberType(PhoneNumber $number) { @@ -2309,85 +2227,3 @@ public function canBeInternationallyDialled(PhoneNumber $number) { } } - -class Matcher { - /** - * @var string - */ - private $pattern; - - /** - * @var string - */ - private $subject; - - /** - * @var array - */ - private $groups = array(); - - /** - * @param $pattern string - * @param $subject string - */ - public function __construct($pattern, $subject) - { - $this->pattern = $pattern; - $this->subject = $subject; - } - - /** - * @return bool - */ - public function matches() { - return preg_match('/^(?:' . str_replace('/', '\/', $this->pattern) . ')$/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0; - } - - /** - * @return bool - */ - public function lookingAt() { - $this->fullPatternMatchesNumber = preg_match_all('/^(?:' . str_replace('/', '\/', $this->pattern) . ')/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE); - return $this->fullPatternMatchesNumber > 0; - } - - /** - * @return bool - */ - public function find() { - return preg_match('/(?:' . str_replace('/', '\/', $this->pattern) . ')/x', $this->subject, $this->groups, PREG_OFFSET_CAPTURE) > 0; - } - - - /** - * @return int - */ - public function groupCount() { - return count($this->groups); - } - - public function group($group = NULL) { - return $this->groups[$group - 1][0]; - } - - /** - * @return int - */ - public function end() { - $lastGroup = $this->groups[$this->fullPatternMatchesNumber - 1][0]; - return $lastGroup[1] + strlen($lastGroup[0]); - } - - public function replaceFirst($replacement) { - return preg_replace('/' . str_replace('/', '\/', $this->pattern) . '/', $replacement, $this->subject, 1); - } - - public function replaceAll($replacement) { - return preg_replace('/' . str_replace('/', '\/', $this->pattern) . '/', $replacement, $this->subject); - } - - public function reset($input = "") { - $this->subject = $input; - return $this; - } -} \ No newline at end of file diff --git a/README.md b/README.md index 5f5cfa2..0e17923 100644 --- a/README.md +++ b/README.md @@ -23,16 +23,16 @@ Let's say you have a string representing a phone number from Switzerland. This i At this point, swissNumberProto contains: - object(com\google\i18n\phonenumbers\PhoneNumber)#221 (5) { - ["countryCode":"com\google\i18n\phonenumbers\PhoneNumber":private]=> + object(libphonenumber\PhoneNumber)#221 (5) { + ["countryCode":"libphonenumber\PhoneNumber":private]=> int(41) - ["nationalNumber":"com\google\i18n\phonenumbers\PhoneNumber":private]=> + ["nationalNumber":"libphonenumber\PhoneNumber":private]=> int(446681800) - ["extension":"com\google\i18n\phonenumbers\PhoneNumber":private]=> + ["extension":"libphonenumber\PhoneNumber":private]=> NULL - ["italianLeadingZero":"com\google\i18n\phonenumbers\PhoneNumber":private]=> + ["italianLeadingZero":"libphonenumber\PhoneNumber":private]=> NULL - ["rawInput":"com\google\i18n\phonenumbers\PhoneNumber":private]=> + ["rawInput":"libphonenumber\PhoneNumber":private]=> NULL } diff --git a/RegionCode.php b/RegionCode.php index 30e9fca..f5aeb91 100644 --- a/RegionCode.php +++ b/RegionCode.php @@ -15,7 +15,7 @@ * limitations under the License. */ -namespace com\google\i18n\phonenumbers; +namespace libphonenumber; /** * Class containing string constants of region codes for easier testing. diff --git a/Tests/PhoneNumberUtilTest.php b/Tests/PhoneNumberUtilTest.php index 38019ef..13c520d 100644 --- a/Tests/PhoneNumberUtilTest.php +++ b/Tests/PhoneNumberUtilTest.php @@ -1,11 +1,34 @@ Date: Mon, 21 May 2012 13:37:35 +0530 Subject: [PATCH 09/13] Moves hardcoded keepRawInput value to PhoneNumberUtil:parse() parameters --- PhoneNumberUtil.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PhoneNumberUtil.php b/PhoneNumberUtil.php index 146e43d..7832bf3 100644 --- a/PhoneNumberUtil.php +++ b/PhoneNumberUtil.php @@ -1029,11 +1029,11 @@ public function parseAndKeepRawInput($numberToParse, $defaultRegion) { * no default region was supplied and the number is not in * international format (does not start with +) */ - public function parse($numberToParse, $defaultRegion, PhoneNumber $phoneNumber = NULL) { + public function parse($numberToParse, $defaultRegion, PhoneNumber $phoneNumber = NULL, $keepRawInput = false) { if ($phoneNumber === NULL) { $phoneNumber = new PhoneNumber(); } - $this->parseHelper($numberToParse, $defaultRegion, true, true, $phoneNumber); + $this->parseHelper($numberToParse, $defaultRegion, $keepRawInput, true, $phoneNumber); return $phoneNumber; } From 0bd0c73f15fb56a24206b799fac5bc641c8c849c Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Fri, 25 May 2012 16:10:14 +0530 Subject: [PATCH 10/13] Mobile pattern update to match 8551###### as valid indian mobile number --- data/PhoneNumberMetadata_IN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/PhoneNumberMetadata_IN b/data/PhoneNumberMetadata_IN index 66d1b7f..682ebf5 100644 --- a/data/PhoneNumberMetadata_IN +++ b/data/PhoneNumberMetadata_IN @@ -277,7 +277,7 @@ return array ( [26]\\d| 30| 4[47]| - 5[39]| + 5[139]| 7[45]| 8[56]| 9[0157] From 4dc985e0063411ed0fa6948886549dc2564fc027 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Sat, 26 May 2012 15:42:27 +0530 Subject: [PATCH 11/13] Mobile pattern update to match 8747###### as valid indian mobile number --- data/PhoneNumberMetadata_IN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/PhoneNumberMetadata_IN b/data/PhoneNumberMetadata_IN index 682ebf5..e508bf8 100644 --- a/data/PhoneNumberMetadata_IN +++ b/data/PhoneNumberMetadata_IN @@ -290,7 +290,7 @@ return array ( 7(?: 1[24]| 33| - 49| + 4[79]| [2569]\\d )| 8(?: From e8ae4ac335a787adf3eee1a934846d528dad0fc5 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Fri, 1 Jun 2012 15:16:35 +0530 Subject: [PATCH 12/13] Updates MetaData on Phone Number Plan & formatting rules from GoogleCode --- data/PhoneNumberMetadata_AN | 8 ++++---- data/PhoneNumberMetadata_ET | 7 ++++++- data/PhoneNumberMetadata_KW | 2 +- data/PhoneNumberMetadata_MN | 9 +++------ data/PhoneNumberMetadata_SX | 7 ++++--- data/PhoneNumberMetadata_TC | 2 +- data/PhoneNumberMetadata_TL | 2 +- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/data/PhoneNumberMetadata_AN b/data/PhoneNumberMetadata_AN index 7f3cb4a..0291ac5 100644 --- a/data/PhoneNumberMetadata_AN +++ b/data/PhoneNumberMetadata_AN @@ -10,7 +10,7 @@ return array ( array ( 'NationalNumberPattern' => ' 5(?: - 4\\d| + 4[2-8]| 8[239] )\\d{4} ', @@ -21,9 +21,9 @@ return array ( array ( 'NationalNumberPattern' => ' 5(?: - 1[01]| - 2[0-7]| - 5\\d| + 1[02]| + 2\\d| + 5[0-79]| 8[016-8] )\\d{4} ', diff --git a/data/PhoneNumberMetadata_ET b/data/PhoneNumberMetadata_ET index 88aa5ac..da6ef45 100644 --- a/data/PhoneNumberMetadata_ET +++ b/data/PhoneNumberMetadata_ET @@ -129,7 +129,12 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => '9[12]\\d{7}', + 'NationalNumberPattern' => ' + 9(?: + [1-3]\\d| + 5[89] + )\\d{6} + ', 'PossibleNumberPattern' => '\\d{9}', 'ExampleNumber' => '911234567', ), diff --git a/data/PhoneNumberMetadata_KW b/data/PhoneNumberMetadata_KW index 51b9acf..713d6b0 100644 --- a/data/PhoneNumberMetadata_KW +++ b/data/PhoneNumberMetadata_KW @@ -48,7 +48,7 @@ return array ( )| 6\\d| 7[067]| - 9[69] + 9[069] )| 9(?: 0[09]| diff --git a/data/PhoneNumberMetadata_MN b/data/PhoneNumberMetadata_MN index ec19569..bd928b6 100644 --- a/data/PhoneNumberMetadata_MN +++ b/data/PhoneNumberMetadata_MN @@ -22,20 +22,17 @@ return array ( 4[2-68]\\d{1,2}| 5[1-4689]\\d{1,2} )\\d{5}| - (?: - 5[0568]| - 70 - )\\d{6} + 5[0568]\\d{6} ', 'PossibleNumberPattern' => '\\d{6,10}', - 'ExampleNumber' => '70123456', + 'ExampleNumber' => '50123456', ), 'mobile' => array ( 'NationalNumberPattern' => ' (?: 8[89]| - 9[15689] + 9[013-9] )\\d{6} ', 'PossibleNumberPattern' => '\\d{8}', diff --git a/data/PhoneNumberMetadata_SX b/data/PhoneNumberMetadata_SX index 36334b8..180d683 100644 --- a/data/PhoneNumberMetadata_SX +++ b/data/PhoneNumberMetadata_SX @@ -11,7 +11,8 @@ return array ( 'NationalNumberPattern' => ' 7215(?: 4[2-8]| - 8[239] + 8[239]| + 9[056] )\\d{4} ', 'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?', @@ -23,8 +24,8 @@ return array ( 7215(?: 1[02]| 2\\d| - 5[03469]| - 8[01678] + 5[034679]| + 8[014-8] )\\d{4} ', 'PossibleNumberPattern' => '\\d{10}', diff --git a/data/PhoneNumberMetadata_TC b/data/PhoneNumberMetadata_TC index 3ff4737..b178452 100644 --- a/data/PhoneNumberMetadata_TC +++ b/data/PhoneNumberMetadata_TC @@ -25,7 +25,7 @@ return array ( 'NationalNumberPattern' => ' 649(?: 2(?: - 3[12]| + 3[129]| 4[1-7] )| 3(?: diff --git a/data/PhoneNumberMetadata_TL b/data/PhoneNumberMetadata_TL index 3f16c66..94c9a9f 100644 --- a/data/PhoneNumberMetadata_TL +++ b/data/PhoneNumberMetadata_TL @@ -20,7 +20,7 @@ return array ( ), 'mobile' => array ( - 'NationalNumberPattern' => '7[2-4]\\d{5}', + 'NationalNumberPattern' => '7[2-49]\\d{5}', 'PossibleNumberPattern' => '\\d{7}', 'ExampleNumber' => '7212345', ), From 1e0520031a39409e23e2590087bd8c026cfde015 Mon Sep 17 00:00:00 2001 From: Ajay Rungta Date: Fri, 1 Jun 2012 15:29:21 +0530 Subject: [PATCH 13/13] Mobile pattern update to match 8740###### as valid indian mobile number --- data/PhoneNumberMetadata_IN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/PhoneNumberMetadata_IN b/data/PhoneNumberMetadata_IN index e508bf8..e4b754e 100644 --- a/data/PhoneNumberMetadata_IN +++ b/data/PhoneNumberMetadata_IN @@ -290,7 +290,7 @@ return array ( 7(?: 1[24]| 33| - 4[79]| + 4[079]| [2569]\\d )| 8(?: