JS: libphonenumber 4.7
authortronikos@gmail.com <tronikos@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 27 Mar 2012 18:12:07 +0000 (18:12 +0000)
committertronikos@gmail.com <tronikos@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 27 Mar 2012 18:12:07 +0000 (18:12 +0000)
git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@438 ee073f10-1060-11df-b6a4-87a95322a99c

javascript/README
javascript/i18n/phonenumbers/metadata.js
javascript/i18n/phonenumbers/metadatalite.js
javascript/i18n/phonenumbers/phonenumberutil.js
javascript/i18n/phonenumbers/phonenumberutil_test.js

index fddbbea..2549284 100644 (file)
@@ -25,7 +25,7 @@ pages with your web browser:
 
 How to update:
 ==============
-The JavaScript library is ported from the Java implementation (revision 421).
+The JavaScript library is ported from the Java implementation (revision 435).
 When the Java project gets updated follow these steps to update the JavaScript
 project:
 
index c7229f5..5126942 100644 (file)
@@ -77,6 +77,7 @@ i18n.phonenumbers.metadata.countryCodeToRegionCodeMap = {
 ,94:["LK"]
 ,95:["MM"]
 ,98:["IR"]
+,211:["SS"]
 ,212:["MA"]
 ,213:["DZ"]
 ,216:["TN"]
@@ -184,7 +185,7 @@ i18n.phonenumbers.metadata.countryCodeToRegionCodeMap = {
 ,596:["MQ"]
 ,597:["SR"]
 ,598:["UY"]
-,599:["AN"]
+,599:["CW","AN","BQ"]
 ,670:["TL"]
 ,672:["NF"]
 ,673:["BN"]
@@ -248,8 +249,8 @@ i18n.phonenumbers.metadata.countryCodeToRegionCodeMap = {
  * @type {Object.<string, Array>}
  */
 i18n.phonenumbers.metadata.countryToMetadata = {
-"AC":[,[,,"[2-46]\\d{3}","\\d{4}"]
-,[,,"(?:3[0-5]|4[4-6]|[26]\\d)\\d{2}","\\d{4}",,,"6889"]
+"AC":[,[,,"[2-467]\\d{3}","\\d{4}"]
+,[,,"(?:3[0-5]|4[4-6]|[26]\\d|70)\\d{2}","\\d{4}",,,"6889"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -371,15 +372,15 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"12[789]","\\d{3}",,,"129"]
 ,[,,"NA","NA"]
 ]
-,"AM":[,[,,"[1-35-9]\\d{7}","\\d{5,8}"]
-,[,,"(?:10\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}","\\d{5,8}",,,"10123456"]
+,"AM":[,[,,"[1-9]\\d{7}","\\d{5,8}"]
+,[,,"(?:10\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2|47\\d)\\d{5}","\\d{5,8}",,,"10123456"]
 ,[,,"(?:55|77|9[1-9])\\d{6}","\\d{8}",,,"77123456"]
 ,[,,"800\\d{5}","\\d{8}",,,"80012345"]
 ,[,,"90[016]\\d{5}","\\d{8}",,,"90012345"]
 ,[,,"80[1-4]\\d{5}","\\d{8}",,,"80112345"]
 ,[,,"NA","NA"]
 ,[,,"6027\\d{4}","\\d{8}",,,"60271234"]
-,"AM",374,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",["1"]
+,"AM",374,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",["1|47"]
 ,"(0$1)","",0]
 ,[,"(\\d{2})(\\d{6})","$1 $2",["[5-7]|9[1-9]"]
 ,"0$1","",0]
@@ -394,20 +395,15 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"10[123]","\\d{3}",,,"102"]
 ,[,,"NA","NA"]
 ]
-,"AN":[,[,,"[13-79]\\d{6,7}","\\d{7,8}"]
-,[,,"(?:318|5(?:25|4\\d|8[239])|7(?:1[578]|50)|9(?:[48]\\d{2}|50\\d|7(?:2[0-2]|[34]\\d|6[35-7]|77)))\\d{4}|416[0239]\\d{3}","\\d{7,8}",,,"7151234"]
-,[,,"(?:318|5(?:1[01]|2[0-7]|5\\d|8[016-8])|7(?:0[01]|[89]\\d)|9(?:5(?:[1246]\\d|3[01])|6(?:[1679]\\d|3[01])))\\d{4}|416[15-8]\\d{3}","\\d{7,8}",,,"3181234"]
+,"AN":[,[,,"5\\d{6}","\\d{7}"]
+,[,,"5(?:4\\d|8[239])\\d{4}","\\d{7}",,,"5451234"]
+,[,,"5(?:1[01]|2[0-7]|5\\d|8[016-8])\\d{4}","\\d{7}",,,"5101234"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,[,,"(?:10|69)\\d{5}","\\d{7,8}",,,"1011234"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"AN",599,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-7]"]
-,"","",0]
-,[,"(9)(\\d{3})(\\d{4})","$1 $2 $3",["9"]
-,"","",0]
-]
-,,[,,"NA","NA"]
+,[,,"NA","NA"]
+,"AN",599,"00",,,,,,,,,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,,[,,"112|911","\\d{3}",,,"112"]
@@ -496,7 +492,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"AT":[,[,,"[1-9]\\d{3,12}","\\d{3,13}"]
-,[,,"1\\d{3,12}|(?:2(?:1[467]|2[134-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:12|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}","\\d{3,13}",,,"1234567890"]
+,[,,"1\\d{3,12}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:12|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}","\\d{3,13}",,,"1234567890"]
 ,[,,"6(?:44|5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}","\\d{7,13}",,,"644123456"]
 ,[,,"80[02]\\d{6,10}","\\d{9,13}",,,"800123456"]
 ,[,,"(?:711|9(?:0[01]|3[019]))\\d{6,10}","\\d{9,13}",,,"900123456"]
@@ -572,14 +568,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,"AX",358,"00|99[049]","0",,,"0",,,,,,[,,"NA","NA"]
-,,,[,,"NA","NA"]
-,[,,"10[1-9]\\d{3,7}|2(?:0(?:[16-8]\\d{3,7}|2[14-9]\\d{1,6}|[3-5]\\d{2,7}|9[0-7]\\d{1,6})|9\\d{4,8})|30[1-9]\\d{3,7}|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345"]
+,,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"100123"]
+,[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345"]
 ,,[,,"112","\\d{3}",,,"112"]
 ,[,,"NA","NA"]
 ]
-,"AZ":[,[,,"[1-9]\\d{7,8}","\\d{5,9}"]
-,[,,"(?:1(?:(?:[28]\\d|9)\\d|02|1[0-589]|3[358]|4[013-79]|5[0-479]|6[02346-9]|7[0-24-8])|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)|365?\\d|44\\d{2})\\d{5}","\\d{5,9}",,,"123123456"]
-,[,,"(?:[46]0|5[015]|7[07])\\d{7}","\\d{9}",,,"401234567"]
+,"AZ":[,[,,"[1-9]\\d{8}","\\d{7,9}"]
+,[,,"(?:1[28]\\d|2(?:02|1[24]|2[2-4]|33|[45]2|6[23])|365)\\d{6}","\\d{7,9}",,,"123123456"]
+,[,,"(?:4[04]|5[015]|60|7[07])\\d{7}","\\d{9}",,,"401234567"]
 ,[,,"88\\d{7}","\\d{9}",,,"881234567"]
 ,[,,"900200\\d{3}","\\d{9}",,,"900200123"]
 ,[,,"NA","NA"]
@@ -587,12 +583,6 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,"AZ",994,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["(?:1[28]|2(?:[45]2|[0-36])|365)"]
 ,"(0$1)","",0]
-,[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["22"]
-,"(0$1)","",0]
-,[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["36[0-46-9]"]
-,"(0$1)","",0]
-,[,"(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[013-79]|2(?:[45][13-9]|[7-9])"]
-,"(0$1)","",0]
 ,[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-8]"]
 ,"0$1","",0]
 ,[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"]
@@ -680,9 +670,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"1(?:0[01]|12)","\\d{3}",,,"112"]
 ,[,,"NA","NA"]
 ]
-,"BF":[,[,,"[2457]\\d{7}","\\d{8}"]
+,"BF":[,[,,"[24-7]\\d{7}","\\d{8}"]
 ,[,,"(?:20(?:49|5[23]|9[016-9])|40(?:4[569]|55|7[0179])|50[34]\\d)\\d{4}","\\d{8}",,,"20491234"]
-,[,,"7(?:[02-68]\\d|1[0-4689]|7[0-6]|9[0-689])\\d{5}","\\d{8}",,,"70123456"]
+,[,,"(?:6(?:0[0-3]|8\\d)|7(?:[02-68]\\d|1[0-4689]|7[0-69]|9[0-689]))\\d{5}","\\d{8}",,,"70123456"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -769,7 +759,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
-,[,,"NA","NA"]
+,[,,"81\\d{6}","\\d{8}",,,"81123456"]
 ,,[,,"11[78]","\\d{3}",,,"117"]
 ,[,,"NA","NA"]
 ]
@@ -836,30 +826,46 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"11[089]","\\d{3}",,,"110"]
 ,[,,"NA","NA"]
 ]
-,"BR":[,[,,"[1-9]\\d{7,9}","\\d{8,10}"]
-,[,,"1[1-9][2-5]\\d{7}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}","\\d{8,10}",,,"1123456789"]
-,[,,"1(?:1(?:[6-9]\\d|5[347])|[2-9][6-9]\\d)\\d{6}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[6-9]\\d{7}","\\d{10}",,,"1161234567"]
-,[,,"800\\d{6,7}","\\d{8,10}",,,"800123456"]
-,[,,"[359]00\\d{6,7}","\\d{8,10}",,,"300123456"]
-,[,,"(?:400\\d|3003)\\d{4}","\\d{8}",,,"40041234"]
+,"BQ":[,[,,"[347]\\d{6}","\\d{7}"]
+,[,,"(?:318[023]|416[0239]|7(?:1[578]|50)\\d)\\d{3}","\\d{7}",,,"7151234"]
+,[,,"(?:318[1456]|416[15-8]|7(?:0[01]|[89]\\d)\\d)\\d{3}|","\\d{7}",,,"3181234"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,"BQ",599,"00",,,,,,,,,,[,,"NA","NA"]
+,,,[,,"NA","NA"]
+,[,,"NA","NA"]
+,,[,,"112|911","\\d{3}",,,"112"]
+,[,,"NA","NA"]
+]
+,"BR":[,[,,"[1-46-9]\\d{7,10}|5\\d{8,9}","\\d{8,11}"]
+,[,,"1[1-9][2-5]\\d{7}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}","\\d{8,11}",,,"1123456789"]
+,[,,"1(?:1(?:5[347]|[6-8]\\d|9\\d{1,2})|[2-9][6-9]\\d)\\d{6}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[6-9]\\d{7}","\\d{10,11}",,,"1161234567"]
+,[,,"800\\d{6,7}","\\d{8,11}",,,"800123456"]
+,[,,"[359]00\\d{6,7}","\\d{8,11}",,,"300123456"]
+,[,,"[34]00\\d{5}","\\d{8}",,,"40041234"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"BR",55,"00(?:1[45]|2[135]|[34]1|43)","0",,,"0(?:(1[245]|2[135]|[34]1)(\\d{10}))?","$2",,,[[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"]
+,"BR",55,"00(?:1[45]|2[135]|[34]1|43)","0",,,"0(?:(1[245]|2[135]|[34]1)(\\d{10,11}))?","$2",,,[[,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["119"]
+,"($1)","0 $CC ($1)",0]
+,[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"]
 ,"($1)","0 $CC ($1)",0]
-,[,"([34]00\\d)(\\d{4})","$1-$2",["[34]00","400|3003"]
+,[,"([34]00\\d)(\\d{4})","$1-$2",["[34]00"]
 ,"","",0]
 ,[,"([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"]
 ,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
-,,,[,,"(?:400\\d|3003)\\d{4}","\\d{8}",,,"40041234"]
+,,,[,,"[34]00\\d{5}","\\d{8}",,,"40041234"]
 ,[,,"NA","NA"]
 ,,[,,"1(?:12|28|9[023])|911","\\d{3}",,,"190"]
 ,[,,"NA","NA"]
 ]
 ,"BS":[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?"]
 ,[,,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[3467]|8[0-4]|9[2-467])|461|502|6(?:12|7[67]|8[78]|9[89])|702)\\d{4}","\\d{7}(?:\\d{3})?",,,"2423456789"]
-,[,,"242(?:3(?:5[79]|[79]5)|4(?:[2-4][1-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[34]|3[35]|44|5[1-9]|65|77)|6[34]6|727)\\d{4}","\\d{10}",,,"2423591234"]
+,[,,"242(?:3(?:5[79]|[79]5)|4(?:[2-4][1-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-9]|65|77)|6[34]6|727)\\d{4}","\\d{10}",,,"2423591234"]
 ,[,,"242300\\d{4}|8(?:00|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002123456"]
 ,[,,"900[2-9]\\d{6}","\\d{10}",,,"9002123456"]
 ,[,,"NA","NA"]
@@ -911,7 +917,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"99[789]","\\d{3}",,,"999"]
 ,[,,"NA","NA"]
 ]
-,"BY":[,[,,"[12-4]\\d{8}|[89]\\d{9,10}","\\d{7,11}"]
+,"BY":[,[,,"[1-4]\\d{8}|[89]\\d{9,10}","\\d{7,11}"]
 ,[,,"(?:1(?:5(?:1[1-5]|2\\d|6[1-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d{2})|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:2\\d|3[02-79]|4[024-7]|5[0-7])))\\d{5}","\\d{7,9}",,,"152450911"]
 ,[,,"(?:2(?:5[5679]|9[1-9])|33\\d|44\\d)\\d{6}","\\d{9}",,,"294911911"]
 ,[,,"8(?:0[13]|20\\d)\\d{7}","\\d{10,11}",,,"8011234567"]
@@ -934,7 +940,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"BZ":[,[,,"[2-8]\\d{6}|0\\d{10}","\\d{7}(?:\\d{4})?"]
 ,[,,"[234578][02]\\d{5}","\\d{7}",,,"2221234"]
-,[,,"6(?:[0-3]\\d|[67][01])\\d{4}","\\d{7}",,,"6221234"]
+,[,,"6[0-367]\\d{5}","\\d{7}",,,"6221234"]
 ,[,,"0800\\d{7}","\\d{11}",,,"08001234123"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -1219,8 +1225,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"90[059]\\d{7}","\\d{10}",,,"9001234567"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,[,,"40(?:00\\d{4}|10[0-3]\\d{3}|2(?:00\\d|900)\\d{2}|3[01]\\d{4}|5\\d{5})","\\d{8}",,,"40001234"]
-,"CR",506,"00",,,,"(19(?:0[0-2]|19|77))",,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[24-7]|8[3-9]"]
+,[,,"210[0-6]\\d{4}|40(?:[04]0\\d{4}|10[0-3]\\d{3}|2(?:00\\d|900)\\d{2}|3[01]\\d{4}|5\\d{5}|70[01]\\d{3})|5100\\d{4}","\\d{8}",,,"40001234"]
+,"CR",506,"00",,,,"(19(?:0[0-2468]|19|66|77))",,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[24-7]|8[3-9]"]
 ,"","$CC $1",0]
 ,[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]0"]
 ,"","$CC $1",0]
@@ -1249,7 +1255,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,,[,,"10[56]","\\d{3}",,,"106"]
+,,[,,"10[456]","\\d{3}",,,"106"]
 ,[,,"NA","NA"]
 ]
 ,"CV":[,[,,"[259]\\d{6}","\\d{7}"]
@@ -1268,6 +1274,25 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"13[012]","\\d{3}",,,"132"]
 ,[,,"NA","NA"]
 ]
+,"CW":[,[,,"[169]\\d{6,7}","\\d{7,8}"]
+,[,,"9(?:[48]\\d{2}|50\\d|7(?:2[0-2]|[34]\\d|6[35-7]|77))\\d{4}","\\d{7,8}",,,"94151234"]
+,[,,"9(?:5(?:[1246]\\d|3[01])|6(?:[1679]\\d|3[01]))\\d{4}","\\d{7,8}",,,"95181234"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"(?:10|69)\\d{5}","\\d{7}",,,"1011234"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,"CW",599,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-7]"]
+,"","",0]
+,[,"(9)(\\d{3})(\\d{4})","$1 $2 $3",["9"]
+,"","",0]
+]
+,,[,,"955\\d{5}","\\d{7,8}",,,"95581234"]
+,1,,[,,"NA","NA"]
+,[,,"NA","NA"]
+,,[,,"112|911","\\d{3}",,,"112"]
+,[,,"NA","NA"]
+]
 ,"CY":[,[,,"[257-9]\\d{7}","\\d{8}"]
 ,[,,"2[2-6]\\d{6}","\\d{8}",,,"22345678"]
 ,[,,"9[5-79]\\d{6}","\\d{8}",,,"96123456"]
@@ -1334,24 +1359,32 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,"0$1","",0]
 ,[,"(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["(?:18|90)0","180|900[1359]"]
 ,"0$1","",0]
+,[,"(1\\d{2})(\\d{5,11})","$1 $2",["181"]
+,"0$1","",0]
+,[,"(18\\d{3})(\\d{6})","$1 $2",["18500"]
+,"0$1","",0]
+,[,"(18\\d{2})(\\d{7})","$1 $2",["18[68]"]
+,"0$1","",0]
+,[,"(18\\d)(\\d{8})","$1 $2",["18[2-579]"]
+,"0$1","",0]
 ,[,"(700)(\\d{4})(\\d{4})","$1 $2 $3",["700"]
 ,"0$1","",0]
 ]
 ,,[,,"16(?:4\\d{1,10}|[89]\\d{1,11})","\\d{4,14}",,,"16412345"]
 ,,,[,,"NA","NA"]
-,[,,"NA","NA"]
+,[,,"18(?:1\\d{5,11}|[2-9]\\d{8})","\\d{8,14}",,,"18500123456"]
 ,,[,,"11[02]","\\d{3}",,,"112"]
 ,[,,"NA","NA"]
 ]
-,"DJ":[,[,,"[1-8]\\d{5}","\\d{6}"]
-,[,,"(?:1[05]|[2-5]\\d)\\d{4}","\\d{6}",,,"251234"]
-,[,,"[6-8]\\d{5}","\\d{6}",,,"601234"]
+,"DJ":[,[,,"[27]\\d{7}","\\d{8}"]
+,[,,"2(?:1[2-5]|7[45]|)\\d{5}","\\d{8}",,,"21360003"]
+,[,,"77[6-8]\\d{5}","\\d{8}",,,"77831001"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"DJ",253,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",,"","",0]
+,"DJ",253,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]
 ]
 ,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
@@ -1460,7 +1493,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,[,,"70[0-2]\\d{5}","\\d{8}",,,"70012345"]
 ,[,,"NA","NA"]
-,"EE",372,"00",,,,,,,,[[,"([34-79]\\d{2})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]"]
+,"EE",372,"00",,,,,,,,[[,"([3-79]\\d{2})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]"]
 ,"","",0]
 ,[,"(70)(\\d{2})(\\d{4})","$1 $2 $3",["70"]
 ,"","",0]
@@ -1476,8 +1509,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"EG":[,[,,"1\\d{4,9}|[2456]\\d{8}|3\\d{7}|[89]\\d{8,9}","\\d{5,10}"]
-,[,,"(?:1[35][23]|2[23]\\d|3\\d|4(?:0[2-4]|[578][23]|64)|5(?:0[234]|[57][23])|6[24-689]3|8(?:[28][2-4]|42|6[23])|9(?:[25]2|3[24]|6[23]|7[2-4]))\\d{6}|1[69]\\d{3}","\\d{5,9}",,,"234567890"]
-,[,,"1(?:[0-246-9]|5[0-2])\\d{7}|1(?:0[0169]|1[124]|2[0278])\\d{7}","\\d{9,10}",,,"1001234567"]
+,[,,"(?:1(3[23]\\d|5[23])|2[2-4]\\d{2}|3\\d{2}|4(?:0[2-5]|[578][23]|64)\\d|5(?:0[2-7]|[57][23])\\d|6[24-689]3\\d|8(?:2[2-57]|4[26]|6[237]|8[2-4])\\d|9(?:2[27]|3[24]|52|6[2356]|7[2-4])\\d)\\d{5}|1[69]\\d{3}","\\d{5,9}",,,"234567890"]
+,[,,"1(?:[0-246-9]|5[0-2])\\d{7}|1(?:0[0169]|1[124]|2[0-278])\\d{7}","\\d{9,10}",,,"1001234567"]
 ,[,,"800\\d{7}","\\d{10}",,,"8001234567"]
 ,[,,"900\\d{7}","\\d{10}",,,"9001234567"]
 ,[,,"NA","NA"]
@@ -1485,11 +1518,11 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,"EG",20,"00","0",,,"0",,,,[[,"(\\d)(\\d{7,8})","$1 $2",["[23]"]
 ,"0$1","",0]
-,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:0[0169]|1[124]|2[0278]|5[0-2])|[89]00"]
+,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:0[0169]|1[124]|2[0-278]|5[0-2])|[89]00"]
 ,"0$1","",0]
 ,[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[0-246-9]|5[3-9])"]
 ,"0$1","",0]
-,[,"(\\d{2})(\\d{7})","$1 $2",["13|[4-6]|[89][2-9]"]
+,[,"(\\d{2})(\\d{6,7})","$1 $2",["1(?:3|5[23])|[4-6]|[89][2-9]"]
 ,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
@@ -1531,7 +1564,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"ET":[,[,,"[1-59]\\d{8}","\\d{7,9}"]
-,[,,"(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-23]|6[5-8])|5(?:1[57]|44|5[0-4])|6(?:18|2[69]|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|22[0-6]|33[0134689]|44[04]|55[0-6]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:11[1-9]|22[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}","\\d{7,9}",,,"111112345"]
+,[,,"(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[57]|44|5[0-4])|6(?:18|2[69]|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|22[0-6]|33[0134689]|44[04]|55[0-6]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:11[1-9]|22[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}","\\d{7,9}",,,"111112345"]
 ,[,,"9[12]\\d{7}","\\d{9}",,,"911234567"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -1554,16 +1587,16 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"FI",358,"00|99[049]","0",,,"0",,,,[[,"(\\d{2})(\\d{4,10})","$1 $2",["2[09]|[14]|50|7[135]"]
+,"FI",358,"00|99[049]","0",,,"0",,,,[[,"(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]00|[6-8]0)"]
 ,"0$1","",0]
-,[,"(\\d)(\\d{4,11})","$1 $2",["[25689][1-8]|3"]
+,[,"(\\d{2})(\\d{4,10})","$1 $2",["2[09]|[14]|50|7[135]"]
 ,"0$1","",0]
-,[,"([6-8]00)(\\d{4,7})","$1 $2",["[6-8]0"]
+,[,"(\\d)(\\d{4,11})","$1 $2",["[25689][1-8]|3"]
 ,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
-,1,,[,,"NA","NA"]
-,[,,"10[1-9]\\d{3,7}|2(?:0(?:[16-8]\\d{3,7}|2[14-9]\\d{1,6}|[3-5]\\d{2,7}|9[0-7]\\d{1,6})|9\\d{4,8})|30[1-9]\\d{3,7}|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345"]
+,1,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"100123"]
+,[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}",,,"10112345"]
 ,,[,,"112","\\d{3}",,,"112"]
 ,[,,"NA","NA"]
 ]
@@ -1653,7 +1686,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"GA":[,[,,"[12]\\d{6}|0\\d{7}","\\d{6,8}"]
 ,[,,"(?:1(?:4[4-8]|7\\d)|2(?:4[02]|5[04-689]|6[024-79]|8[236]|9[02368]))\\d{4}","\\d{6,7}",,,"1441234"]
-,[,,"0(?:5(?:0[89]|3[0-4]|8[0-26]|9[238])|6(?:0[3-7]|1[01]|2[0-7]|6[0-589]|71|83|9[57])|7(?:1[2-5]|2[89]|3[35-9]|4[01]|5[0-347-9]|[67]\\d|8[457-9]|9[0146]))\\d{4}","\\d{8}",,,"06031234"]
+,[,,"0(?:5(?:0[89]|3[0-4]|8[0-26]|9[238])|6(?:0[3-7]|1[01]|2[0-7]|6[0-589]|71|83|9[57])|7(?:1[2-5]|2[89]|3[35-9]|4[01]|5[0-47-9]|[67]\\d|8[457-9]|9[0146]))\\d{4}","\\d{8}",,,"06031234"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -1768,18 +1801,21 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"112|999","\\d{3}",,,"999"]
 ,[,,"NA","NA"]
 ]
-,"GH":[,[,,"[235]\\d{6,8}","\\d{7,9}"]
+,"GH":[,[,,"[235]\\d{8}|8\\d{7}","\\d{7,9}"]
 ,[,,"3(?:0[237]\\d|[167](?:2[0-6]|7\\d)|2(?:2[0-5]|7\\d)|3(?:2[0-37]|7\\d)|4(?:[27]\\d|30)|5(?:2[0-7]|7\\d)|8(?:2[0-2]|7\\d)|9(?:20|7\\d))\\d{5}","\\d{7,9}",,,"302345678"]
 ,[,,"(?:2[034678]|5[47])\\d{7}","\\d{9}",,,"231234567"]
+,[,,"800\\d{5}","\\d{8}",,,"80012345"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,[,,"NA","NA"]
-,"GH",233,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",,"0$1","",0]
+,"GH",233,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"]
+,"0$1","",0]
+,[,"(\\d{3})(\\d{5})","$1 $2",["8"]
+,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
-,,,[,,"NA","NA"]
+,,,[,,"800\\d{5}","\\d{8}",,,"80012345"]
 ,[,,"NA","NA"]
 ,,[,,"19[123]|999","\\d{3}",,,"999"]
 ,[,,"NA","NA"]
@@ -1969,7 +2005,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"HK":[,[,,"[235-7]\\d{7}|8\\d{7,8}|9\\d{7,10}","\\d{8,11}"]
 ,[,,"[23]\\d{7}","\\d{8}",,,"21234567"]
-,[,,"[5-79]\\d{7}","\\d{8}",,,"51234567"]
+,[,,"[569]\\d{7}","\\d{8}",,,"51234567"]
 ,[,,"800\\d{6}","\\d{9}",,,"800123456"]
 ,[,,"900\\d{8}","\\d{11}",,,"90012345678"]
 ,[,,"NA","NA"]
@@ -1982,14 +2018,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,"(900)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["900"]
 ,"","",0]
 ]
-,,[,,"NA","NA"]
+,,[,,"7\\d{7}","\\d{8}",,,"71234567"]
 ,,,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,,[,,"112|99[29]","\\d{3}",,,"999"]
 ,[,,"NA","NA"]
 ]
 ,"HN":[,[,,"[237-9]\\d{7}","\\d{8}"]
-,[,,"2(?:2(?:0[019]|1[1-36]|[23]\\d|4[056]|5[57]|9[01])|4(?:2|3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:4[3-5]|5\\d|6[56]|74)|6(?:4[0-378]|[56]\\d|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[34])|8(?:79|8[0-35789]|9[1-57-9]))\\d{4}","\\d{8}",,,"22123456"]
+,[,,"2(?:2(?:0[019]|1[1-36]|[23]\\d|4[056]|5[57]|8[0146-9]|9[012])|4(?:2|3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:4[3-5]|5\\d|6[56]|74)|6(?:4[0-378]|[56]\\d|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[34])|8(?:79|8[0-35789]|9[1-57-9]))\\d{4}","\\d{8}",,,"22123456"]
 ,[,,"[37-9]\\d{7}","\\d{8}",,,"91234567"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -2075,8 +2111,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"ID":[,[,,"[1-9]\\d{6,10}","\\d{5,11}"]
-,[,,"2[124]\\d{7,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|2[1-578]|3[1-68]|4[1-3]|5[1-8]|6[1-3568]|7[0-46]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[1246-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:19?|[25]\\d|3[1-469]|4[1-6])|7(?:1[1-46-9]|2[14-9]|[36]\\d|4[1-8]|5[1-9]|7[0-36-9])|9(?:0[12]|1[0134-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}","\\d{5,10}",,,"612345678"]
-,[,,"8[1-35-9]\\d{7,9}","\\d{9,11}",,,"812345678"]
+,[,,"2(?:1(?:[0-8]\\d{6,7}|9\\d{6})|[24]\\d{7,8})|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|2[1-578]|3[1-68]|4[1-3]|5[1-8]|6[1-3568]|7[0-46]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[1246-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:19?|[25]\\d|3[1-469]|4[1-6])|7(?:1[1-46-9]|2[14-9]|[36]\\d|4[1-8]|5[1-9]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}","\\d{5,10}",,,"612345678"]
+,[,,"(?: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}","\\d{9,11}",,,"812345678"]
 ,[,,"177\\d{6,8}|800\\d{5,7}","\\d{8,11}",,,"8001234567"]
 ,[,,"809\\d{7}","\\d{10}",,,"8091234567"]
 ,[,,"NA","NA"]
@@ -2180,14 +2216,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"IN":[,[,,"1\\d{7,12}|[2-9]\\d{9,10}","\\d{6,13}"]
-,[,,"(?: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}","\\d{6,10}",,,"1123456789"]
-,[,,"(?: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[245789]|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[235-8]|4[14789]|74|90)|4(?:[02-58]\\d|10|6[09])|5(?:0[079]|11|2\\d|30|4[47]|53|7[45]|9[015])|6(?:[0589]\\d|7[09])|7(?:1[24]|[2569]\\d)|8(?:[07-9]\\d|17|2[024-8]|44|5[389]|6[0167])|9(?:[057-9]\\d|2[35-9]|3[09]|4[036-8]|6[0-46-9]))|9\\d{3})\\d{6}","\\d{10}",,,"9123456789"]
+,[,,"(?:11|2[02]|33|4[04]|79)[2-7]\\d{7}|80[2-467]\\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-7]\\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]|[57][2-689]|6[24-58]|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-7]\\d{5}","\\d{6,10}",,,"1123456789"]
+,[,,"(?: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}","\\d{10}",,,"9123456789"]
 ,[,,"1(?:600\\d{6}|80(?:0\\d{4,8}|3\\d{9}))","\\d{8,13}",,,"1800123456"]
 ,[,,"186[12]\\d{9}","\\d{13}",,,"1861123456789"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"IN",91,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{2})(\\d{6})","$1 $2 $3",["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-579]6[05789]7[12569]|8[0124-9]|9[02-9])|9","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[245789]|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[235-8]|4[14789]|74|90)|4(?:[02-58]|10|6[09])|5(?:0[079]|11|2|30|4[47]|53|7[45]|9[015])|6(?:[0589]|70)|7(?:1[24]|[2569])|8(?:[07-9]|17|2[024-8]|44|5[389]|6[0167])|9(?:[057-9]|2[35-9]|3[09]|4[03678]|6[0-46-9]))|9"]
+,"IN",91,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{2})(\\d{6})","$1 $2 $3",["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","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"]
 ,"0$1","",1]
 ,[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79|80[2-46]"]
 ,"0$1","",1]
@@ -2401,9 +2437,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,"0$1","",0]
 ,[,"(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:76|97)9|499[2468]|7468|8(?:3(?:8[78]|96)|636|477|51[24])|9(?:496|802|9(?:1[23]|69))","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:769|979[2-69])|499[2468]|7468|8(?:3(?:8[78]|96[2457-9])|636[2-57-9]|477|51[24])|9(?:496|802|9(?:1[23]|69))"]
 ,"0$1","",0]
-,[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[034-9]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[0245-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-56]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[0245-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[0245-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[0245-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"]
+,[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-9]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-6]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"]
 ,"0$1","",0]
-,[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:23|5[5-89]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:23|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:23|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"]
+,[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:23|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:23|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:23|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"]
 ,"0$1","",0]
 ,[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["2(?:9[14-79]|74|[34]7|[56]9)|82|993"]
 ,"0$1","",0]
@@ -2418,11 +2454,11 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,1,[,,"11[09]","\\d{3}",,,"110"]
 ,[,,"NA","NA"]
 ]
-,"KE":[,[,,"20\\d{4,7}|[4-9]\\d{5,9}","\\d{4,10}"]
-,[,,"(?:20|4[0-6]|5\\d|6[0-24-9])\\d{4,7}","\\d{4,9}",,,"202012345"]
-,[,,"7(?:0[0-5]|[123]\\d|5[0-4]|7[0-5]|8[6-9])\\d{6}","\\d{9}",,,"712123456"]
-,[,,"800[245-8]\\d{5,6}","\\d{9,10}",,,"800223456"]
-,[,,"9(?:00[2-578]|11\\d)\\d{5}","\\d{9}",,,"900223456"]
+,"KE":[,[,,"20\\d{6,7}|[4-9]\\d{6,9}","\\d{5,10}"]
+,[,,"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})","\\d{5,9}",,,"202012345"]
+,[,,"7(?:0[0-8]|[123]\\d|5[0-5]|7[0-5]|8[5-9])\\d{6}","\\d{9}",,,"712123456"]
+,[,,"800[24-8]\\d{5,6}","\\d{9,10}",,,"800223456"]
+,[,,"900[02-578]\\d{5}","\\d{9}",,,"900223456"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -2439,7 +2475,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"112|999","\\d{3}",,,"999"]
 ,[,,"NA","NA"]
 ]
-,"KG":[,[,,"[356-8]\\d{8,9}","\\d{5,10}"]
+,"KG":[,[,,"[35-8]\\d{8,9}","\\d{5,10}"]
 ,[,,"(?:3(?:1(?:2\\d|3[1-9]|47|5[02]|6[1-8])|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6[0-4])|5(?:22|3[4-7]|59|6[0-5])|6(?:22|5[35-7]|6[0-3])|7(?:22|3[468]|4[1-9]|59|6\\d|7[5-7])|9(?:22|4[1-8]|6[0-8]))|6(?:09|12|2[2-4])\\d)\\d{5}","\\d{5,10}",,,"312123456"]
 ,[,,"5[124-7]\\d{7}|7(?:0[0-357-9]|7\\d)\\d{6}","\\d{9}",,,"700123456"]
 ,[,,"800\\d{6,7}","\\d{9,10}",,,"800123456"]
@@ -2462,7 +2498,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"KH":[,[,,"[1-9]\\d{7,9}","\\d{6,10}"]
 ,[,,"(?:2[3-6]|3[2-6]|4[2-4]|[567][2-5])[2-46-9]\\d{5}","\\d{6,8}",,,"23456789"]
-,[,,"(?:(?:1[0-35-9]|6[6-9]|7[06-89])[1-9]|8(?:0[89]|5[2-689]|8\\d{2}|[13469]\\d|)|9(?:[0-689][1-9]|7[1-9]\\d?))\\d{5}","\\d{8,9}",,,"91234567"]
+,[,,"(?:(?:1[0-35-9]|6[6-9]|7[06-9])[1-9]|8(?:0[89]|5[2-689]|8\\d{2}|[13469]\\d|)|9(?:[0-689][1-9]|7[1-9]\\d?))\\d{5}","\\d{8,9}",,,"91234567"]
 ,[,,"1800(?:1\\d|2[019])\\d{4}","\\d{10}",,,"1800123456"]
 ,[,,"1900(?:1\\d|2[09])\\d{4}","\\d{10}",,,"1900123456"]
 ,[,,"NA","NA"]
@@ -2552,7 +2588,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,[,,"50\\d{8}","\\d{10}",,,"5012345678"]
 ,[,,"70\\d{8}","\\d{10}",,,"7012345678"]
-,"KR",82,"00(?:[124-68]|[37]\\d{2})","0",,,"0(8[1-46-8]|85\\d{2})?",,,,[[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"]
+,"KR",82,"00(?:[124-68]|[37]\\d{2})","0",,,"0(8[1-46-8]|85\\d{2})?",,,,[[,"(\\d{3})","$1",["11[29]"]
+,"$1","0$CC-$1",0]
+,[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"]
 ,"0$1","0$CC-$1",0]
 ,[,"(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][2-9]","1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-6][1-9][2-9]"]
 ,"0$1","0$CC-$1",0]
@@ -2581,7 +2619,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"KW":[,[,,"[12569]\\d{6,7}|65816\\d{6}","\\d{7,8}|\\d{11}"]
 ,[,,"(?:18\\d|2(?:[23]\\d{2}|4[1-35-9]\\d|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7])))\\d{4}","\\d{7,8}",,,"22345678"]
-,[,,"(?:5(?:0[0-26]|5\\d)|6(?:0[034679]|5(?:[015-79]|8(?:[02-9]|1[0-57-9]))|6\\d|7[067]|9[69])|9(?:0[09]|4[049]|66|[79]\\d))\\d{5}","\\d{8}",,,"50012345"]
+,[,,"(?:5(?:0[0-2568]|5\\d)|6(?:0[034679]|5(?:[015-79]|8(?:[02-9]|1[0-57-9]))|6\\d|7[067]|9[69])|9(?:0[09]|4[049]|66|[79]\\d))\\d{5}","\\d{8}",,,"50012345"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -2601,14 +2639,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"65816\\d{6}","\\d{11}",,,"65816123456"]
 ]
 ,"KY":[,[,,"[3589]\\d{9}","\\d{7}(?:\\d{3})?"]
-,[,,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:6[6-9]|77)|8(?:00|1[45]|25|4[89]|88)|9(?:14|4[035-9]))\\d{4}","\\d{7}(?:\\d{3})?",,,"3452221234"]
-,[,,"345(?:32[3-79]|5(?:1[467]|2[5-7]|4[5-9])|9(?:1[679]|2[4-9]|3[89]))\\d{4}","\\d{10}",,,"3453231234"]
+,[,,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}","\\d{7}(?:\\d{3})?",,,"3452221234"]
+,[,,"345(?:32[1-9]|5(?:1[67]|2[5-7]|4[6-8]|76)|9(?:1[67]|2[3-9]|3[689]))\\d{4}","\\d{10}",,,"3453231234"]
 ,[,,"8(?:00|55|66|77|88)[2-9]\\d{6}","\\d{10}",,,"8002345678"]
 ,[,,"900[2-9]\\d{6}|345976\\d{4}","\\d{10}",,,"9002345678"]
 ,[,,"NA","NA"]
 ,[,,"5(?:00|33|44)[2-9]\\d{6}","\\d{10}",,,"5002345678"]
 ,[,,"NA","NA"]
-,"KY",1,"011","1",,,"1",,,,,,[,,"NA","NA"]
+,"KY",1,"011","1",,,"1",,,,,,[,,"345849\\d{4}","\\d{10}",,,"3458491234"]
 ,,"345",[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,,[,,"911","\\d{3}",,,"911"]
@@ -2649,7 +2687,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"LB":[,[,,"[13-9]\\d{6,7}","\\d{7,8}"]
 ,[,,"(?:[14-6]\\d{2}|7(?:[2-57-9]\\d|62)|[89][2-9]\\d)\\d{4}","\\d{7}",,,"1123456"]
-,[,,"(?:3\\d|7(?:[01]\\d|6[01346-9]))\\d{5}","\\d{7,8}",,,"71123456"]
+,[,,"(?:3\\d|7(?:[01]\\d|6[013-9]))\\d{5}","\\d{7,8}",,,"71123456"]
 ,[,,"NA","NA"]
 ,[,,"9[01]\\d{6}","\\d{8}",,,"90123456"]
 ,[,,"8[01]\\d{6}","\\d{8}",,,"80123456"]
@@ -2657,7 +2695,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,"LB",961,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-6]|7(?:[2-57-9]|62)|[89][2-9]"]
 ,"0$1","",0]
-,[,"([7-9]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89][01]|7(?:[01]|6[01346-9])"]
+,[,"([7-9]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89][01]|7(?:[01]|6[013-9])"]
 ,"","",0]
 ]
 ,,[,,"NA","NA"]
@@ -2792,9 +2830,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"801\\d{5}","\\d{8}",,,"80112345"]
 ,[,,"70\\d{6}","\\d{8}",,,"70123456"]
 ,[,,"20\\d{2,8}","\\d{4,10}",,,"2012345"]
-,"LU",352,"00",,,,"(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)",,,,[[,"(\\d{2})(\\d{3})","$1 $2",["[23-5]|7[1-9]|[89](?:[1-9]|0[2-9])"]
+,"LU",352,"00",,,,"(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)",,,,[[,"(\\d{2})(\\d{3})","$1 $2",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"]
 ,"","$CC $1",0]
-,[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[23-5]|7[1-9]|[89](?:[1-9]|0[2-9])"]
+,[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"]
 ,"","$CC $1",0]
 ,[,"(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20"]
 ,"","$CC $1",0]
@@ -2818,11 +2856,11 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"LV":[,[,,"[2689]\\d{7}","\\d{8}"]
-,[,,"6\\d{7}","\\d{8}",,,"61234567"]
+,[,,"6[3-8]\\d{6}","\\d{8}",,,"63123456"]
 ,[,,"2\\d{7}","\\d{8}",,,"21234567"]
 ,[,,"80\\d{6}","\\d{8}",,,"80123456"]
 ,[,,"90\\d{6}","\\d{8}",,,"90123456"]
-,[,,"NA","NA"]
+,[,,"81\\d{6}","\\d{8}",,,"81123456"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,"LV",371,"00",,,,,,,,[[,"([2689]\\d)(\\d{3})(\\d{3})","$1 $2 $3",,"","",0]
@@ -2851,7 +2889,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"MA":[,[,,"[5689]\\d{8}","\\d{9}"]
 ,[,,"5(?:2(?:(?:[015-7]\\d|2[2-9]|3[2-57]|4[2-8]|8[235-9]|)\\d|9(?:0\\d|[89]0))|3(?:(?:[0-4]\\d|[57][2-9]|6[235-8]|9[3-9])\\d|8(?:0\\d|[89]0)))\\d{4}","\\d{9}",,,"520123456"]
-,[,,"6(?:0[0-36]|[14-7]\\d|2[236]|3[348]|99)\\d{6}","\\d{9}",,,"650123456"]
+,[,,"6(?:0[0-6]|[14-7]\\d|2[23679]|3[03458]|80|99)\\d{6}","\\d{9}",,,"650123456"]
 ,[,,"80\\d{7}","\\d{9}",,,"801234567"]
 ,[,,"89\\d{7}","\\d{9}",,,"891234567"]
 ,[,,"NA","NA"]
@@ -2893,7 +2931,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"1(?:12|[578])","\\d{2,3}",,,"112"]
 ,[,,"NA","NA"]
 ]
-,"MD":[,[,,"[256-9]\\d{7}","\\d{8}"]
+,"MD":[,[,,"[25-9]\\d{7}","\\d{8}"]
 ,[,,"(?:2(?:1[0569]|2\\d|3[015-7]|4[1-46-9]|5[0-24689]|6[2-589]|7[1-37]|9[1347-9])|5(?:33|5[257]))\\d{5}","\\d{5,8}",,,"22212345"]
 ,[,,"(?:562|6(?:50|7[1-4]|[089]\\d)|7(?:7[47-9]|[89]\\d))\\d{5}","\\d{8}",,,"65012345"]
 ,[,,"800\\d{5}","\\d{8}",,,"80012345"]
@@ -2980,7 +3018,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"MK":[,[,,"[2-578]\\d{7}","\\d{8}"]
-,[,,"(?:2(?:[23]\\d|5[125]|61)|3(?:1[3-6]|2[2-6]|3[2-5]|4[235])|4(?:[23][2-6]|4[3-6]|5[25]|6[25-8]|7[24-6]|8[4-6]))\\d{5}","\\d{6,8}",,,"22212345"]
+,[,,"(?:2(?:[23]\\d|5[125]|6[01])|3(?:1[3-6]|2[2-6]|3[2-5]|4[235])|4(?:[23][2-6]|4[3-6]|5[25]|6[25-8]|7[24-6]|8[4-6]))\\d{5}","\\d{6,8}",,,"22212345"]
 ,[,,"7[0-25-8]\\d{6}","\\d{8}",,,"72345678"]
 ,[,,"800\\d{5}","\\d{8}",,,"80012345"]
 ,[,,"5[02-9]\\d{6}","\\d{8}",,,"50012345"]
@@ -3195,22 +3233,20 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"1(?:02|19)","\\d{3}",,,"102"]
 ,[,,"NA","NA"]
 ]
-,"MW":[,[,,"(?:[3-5]|[27]\\d{2}|[189](?:\\d{2})?)\\d{6}","\\d{7,9}"]
+,"MW":[,[,,"(?:1(?:\\d{2})?|[2789]\\d{2})\\d{6}","\\d{7,9}"]
 ,[,,"(?:1[2-9]|21\\d{2})\\d{5}","\\d{7,9}",,,"1234567"]
-,[,,"(?:111|[3-5]|77\\d|8(?:8\\d)?|9(?:9\\d)?)\\d{6}","\\d{7,9}",,,"991234567"]
+,[,,"(?:111|77\\d|88\\d|99\\d)\\d{6}","\\d{9}",,,"991234567"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"MW",265,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-5]"]
+,"MW",265,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1"]
 ,"0$1","",0]
 ,[,"(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"]
 ,"0$1","",0]
 ,[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1789]"]
 ,"0$1","",0]
-,[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89]"]
-,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
@@ -3297,7 +3333,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"NA":[,[,,"[68]\\d{7,8}","\\d{8,9}"]
-,[,,"6(?:1(?:17|2(?:[0189]\\d|[23-6]|7\\d?)|3(?:2\\d|3[378])|4[01]|69|7[014])|2(?:17|25|5(?:[0-36-8]|4\\d?)|69|70)|3(?:17|2(?:[0237]\\d?|[14-689])|34|6[29]|7[01]|81)|4(?:17|2(?:[012]|7?)|4(?:[06]|1\\d)|5(?:[01357]|[25]\\d?)|69|7[01])|5(?:17|2(?:[0459]|[23678]\\d?)|69|7[01])|6(?:17|2(?:5|6\\d?)|38|42|69|7[01])|7(?:17|2(?:[569]|[234]\\d?)|3(?:0\\d?|[13])|69|7[01]))\\d{4}","\\d{8,9}",,,"612012345"]
+,[,,"6(?:1(?:17|2(?:[0189]\\d|[2-6]|7\\d?)|3(?:2\\d|3[378])|4[01]|69|7[014])|2(?:17|25|5(?:[0-36-8]|4\\d?)|69|70)|3(?:17|2(?:[0237]\\d?|[14-689])|34|6[29]|7[01]|81)|4(?:17|2(?:[012]|7?)|4(?:[06]|1\\d)|5(?:[01357]|[25]\\d?)|69|7[01])|5(?:17|2(?:[0459]|[23678]\\d?)|69|7[01])|6(?:17|2(?:5|6\\d?)|38|42|69|7[01])|7(?:17|2(?:[569]|[234]\\d?)|3(?:0\\d?|[13])|69|7[01]))\\d{4}","\\d{8,9}",,,"612012345"]
 ,[,,"(?:60|8[125])\\d{7}","\\d{9}",,,"811234567"]
 ,[,,"NA","NA"]
 ,[,,"8701\\d{5}","\\d{9}",,,"870123456"]
@@ -3337,7 +3373,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"NE":[,[,,"[029]\\d{7}","\\d{8}"]
 ,[,,"2(?:0(?:20|3[1-7]|4[134]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}","\\d{8}",,,"20201234"]
-,[,,"9[0134678]\\d{6}","\\d{8}",,,"93123456"]
+,[,,"9[0-46-9]\\d{6}","\\d{8}",,,"93123456"]
 ,[,,"08\\d{6}","\\d{8}",,,"08123456"]
 ,[,,"09\\d{6}","\\d{8}",,,"09123456"]
 ,[,,"NA","NA"]
@@ -3515,7 +3551,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"NZ":[,[,,"6[235-9]\\d{6}|[2-57-9]\\d{7,10}","\\d{7,11}"]
 ,[,,"(?:3[2-79]|[49][2-689]|6[235-9]|7[2-589])\\d{6}|24099\\d{3}","\\d{7,8}",,,"32345678"]
-,[,,"2(?:[079]\\d{7}|1(?:0\\d{5,7}|[12]\\d{5,6}|[3-9]\\d{5})|[28]\\d{7,8}|4[1-9]\\d{6})","\\d{8,10}",,,"211234567"]
+,[,,"2(?:[028]\\d{7,8}|1(?:0\\d{5,7}|[12]\\d{5,6}|[3-9]\\d{5})|[79]\\d{7})","\\d{8,10}",,,"211234567"]
 ,[,,"508\\d{6,7}|80\\d{6,8}","\\d{8,10}",,,"800123456"]
 ,[,,"90\\d{7,9}","\\d{9,11}",,,"900123456"]
 ,[,,"NA","NA"]
@@ -3523,15 +3559,15 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,"NZ",64,"0(?:0|161)","0",,,"0",,"00",,[[,"([34679])(\\d{3})(\\d{4})","$1-$2 $3",["[3467]|9[1-9]"]
 ,"0$1","",0]
-,[,"(21)(\\d{4})(\\d{3,4})","$1 $2 $3",["21"]
+,[,"(24099)(\\d{3})","$1 $2",["240","2409","24099"]
 ,"0$1","",0]
-,[,"(22)(\\d{3})(\\d{4})","$1 $2 $3",["22"]
+,[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["21"]
 ,"0$1","",0]
-,[,"([2589]\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[0247-9]|5|[89]00"]
+,[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[1-9]|[69]|7[0-35-9])|86"]
 ,"0$1","",0]
-,[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[0169]|86"]
+,[,"(2\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["2[028]"]
 ,"0$1","",0]
-,[,"(24099)(\\d{3})","$1 $2",["240","2409","24099"]
+,[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|5|[89]0"]
 ,"0$1","",0]
 ]
 ,,[,,"[28]6\\d{6,7}","\\d{8,9}",,,"26123456"]
@@ -3885,8 +3921,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"112","\\d{3}",,,"112"]
 ,[,,"NA","NA"]
 ]
-,"RS":[,[,,"[1-36-9]\\d{4,11}","\\d{5,12}"]
-,[,,"[1-3]\\d{6,11}","\\d{5,12}",,,"101234567"]
+,"RS":[,[,,"[126-9]\\d{4,11}|3(?:[0-79]\\d{3,10}|8[2-9]\\d{2,9})","\\d{5,12}"]
+,[,,"(?:1(?:[02-9][2-9]|1[1-9])\\d|2(?:[0-24-7][2-9]\\d|[389](?:0[2-9]|[2-9]\\d))|3(?:[0-8][2-9]\\d|9(?:[2-9]\\d|0[2-9])))\\d{3,8}","\\d{5,12}",,,"10234567"]
 ,[,,"6(?:[0-689]|7\\d)\\d{6,7}","\\d{8,10}",,,"601234567"]
 ,[,,"800\\d{3,9}","\\d{6,12}",,,"80012345"]
 ,[,,"(?:90[0169]|78\\d)\\d{3,7}","\\d{6,12}",,,"90012345"]
@@ -3953,7 +3989,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"SA":[,[,,"[1-467]\\d{7}|5\\d{8}|(?:8|92)\\d{9}","\\d{7,11}"]
-,[,,"(?:[12][24-8]|3[35-8]|4[34-68]|6[2-5]|7[235-7])\\d{6}","\\d{7,8}",,,"12345678"]
+,[,,"(?:[12][24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}","\\d{7,8}",,,"12345678"]
 ,[,,"(?:5[013-689]\\d|8111)\\d{6}","\\d{9,10}",,,"512345678"]
 ,[,,"800\\d{7}","\\d{10}",,,"8001234567"]
 ,[,,"9200\\d{7}","\\d{11}",,,"92001234567"]
@@ -3979,7 +4015,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"SB":[,[,,"[1-8]\\d{4,6}","\\d{5,7}"]
 ,[,,"(?:1[4-79]|[23]\\d|4[01]|5[03]|6[0-37])\\d{3}","\\d{5}",,,"40123"]
-,[,,"7(?:4\\d|5[025-8]|6[01])\\d{4}|8[4-8]\\d{5}","\\d{7}",,,"7421234"]
+,[,,"48\\d{3}|7(?:4\\d|5[025-8]|6[0-4])\\d{4}|8[4-8]\\d{5}","\\d{5,7}",,,"7421234"]
 ,[,,"1[38]\\d{3}","\\d{5}",,,"18123"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -3995,8 +4031,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"SC":[,[,,"[24689]\\d{5,6}","\\d{6,7}"]
-,[,,"(?:2(?:55[0-5]|78[013])|4(?:2(?:0[589]|1[03-9]|[2-9]\\d)|[346]\\d{2}))\\d{3}","\\d{7}",,,"4217123"]
-,[,,"2(?:5(?:[0-46-9]\\d|5[6-9])|7(?:[0-79]\\d|8[24-9]))\\d{3}","\\d{7}",,,"2510123"]
+,[,,"4[2-46]\\d{5}","\\d{7}",,,"4217123"]
+,[,,"2[5-8]\\d{5}","\\d{7}",,,"2510123"]
 ,[,,"8000\\d{2}","\\d{6}",,,"800000"]
 ,[,,"98\\d{4}","\\d{6}",,,"981234"]
 ,[,,"NA","NA"]
@@ -4030,7 +4066,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"SE":[,[,,"[1-9]\\d{6,9}","\\d{5,10}"]
-,[,,"1(?:0[1-8]\\d{6}|[136]\\d{5,7}|(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)\\d{5,6})|2(?:[136]\\d{5,7}|(?:2[0-7]|4[0136-8]|5[0-38]|7[018]|8[01]|9[0-57])\\d{5,6})|3(?:[356]\\d{5,7}|(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])\\d{5,6})|4(?:[0246]\\d{5,7}|(?:1[01-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])\\d{5,6})|5(?:0[0-6]|1[0-5]|2[0-68]|3[0-4]|4\\d|5[0-5]|6[03-5]|7[013]|8[0-79]|9[01])\\d{5,6}|6(?:[03]\\d{5,7}|(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])\\d{5,6})|8\\d{6,8}|9(?:0\\d{5,7}|(?:1[0-68]|2\\d|3[02-59]|4[0-4]|5[0-4]|6[01]|7[0135-8]|8[01])\\d{5,6})","\\d{5,9}",,,"8123456"]
+,[,,"1(?:0[1-8]\\d{6}|[136]\\d{5,7}|(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)\\d{5,6})|2(?:[136]\\d{5,7}|(?:2[0-7]|4[0136-8]|5[0-38]|7[018]|8[01]|9[0-57])\\d{5,6})|3(?:[356]\\d{5,7}|(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])\\d{5,6})|4(?:[0246]\\d{5,7}|(?:1[0-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])\\d{5,6})|5(?:0[0-6]|1[0-5]|2[0-68]|3[0-4]|4\\d|5[0-5]|6[03-5]|7[013]|8[0-79]|9[01])\\d{5,6}|6(?:[03]\\d{5,7}|(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])\\d{5,6})|8\\d{6,8}|9(?:0\\d{5,7}|(?:1[0-68]|2\\d|3[02-59]|4[0-4]|5[0-4]|6[01]|7[0135-8]|8[01])\\d{5,6})","\\d{5,9}",,,"8123456"]
 ,[,,"7[02-46]\\d{7}","\\d{9}",,,"701234567"]
 ,[,,"20\\d{4,7}","\\d{6,9}",,,"201234567"]
 ,[,,"9(?:00|39|44)\\d{7}","\\d{10}",,,"9001234567"]
@@ -4174,7 +4210,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"SL":[,[,,"[2-578]\\d{7}","\\d{6,8}"]
 ,[,,"[235]2[2-4][2-9]\\d{4}","\\d{6,8}",,,"22221234"]
-,[,,"(?:25|3[03]|44|5[056]|7[6-8]|88)[1-9]\\d{5}","\\d{6,8}",,,"25123456"]
+,[,,"(?:25|3[03]|44|5[056]|7[6-9]|88)\\d{6}","\\d{6,8}",,,"25123456"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -4218,7 +4254,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"SN":[,[,,"[37]\\d{8}","\\d{9}"]
 ,[,,"3(?:010|3(?:8[1-9]|9[2-9]))\\d{5}","\\d{9}",,,"301012345"]
-,[,,"7(?:0[1256]0|6(?:1[23]|2[89]|3[3489]|4[6-9]|5[1-9]|6[3-9]|7[45]|8[3-8])|7(?:01|[12-79]\\d|8[0139]))\\d{5}","\\d{9}",,,"701012345"]
+,[,,"7(?:0[1256]0|6(?:1[23]|2[89]|3[3489]|4[6-9]|5[1-9]|6[3-9]|7[45]|8[3-8])|7(?:01|[1-9]\\d))\\d{5}","\\d{9}",,,"701012345"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -4278,6 +4314,22 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"115","\\d{3}",,,"115"]
 ,[,,"NA","NA"]
 ]
+,"SS":[,[,,"[1489]\\d{8}","\\d{9}"]
+,[,,"(?:1[67]\\d|811)\\d{6}","\\d{9}",,,"811123456"]
+,[,,"(?:1(?:02|2[1269])|477|9(?:0[03689]|1\\d|2[024-9]|5[5-79]|77|98))\\d{6}","\\d{9}",,,"977123456"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,"SS",211,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",,"0$1","",0]
+]
+,,[,,"NA","NA"]
+,,,[,,"NA","NA"]
+,[,,"NA","NA"]
+,,[,,"NA","NA"]
+,[,,"NA","NA"]
+]
 ,"ST":[,[,,"[29]\\d{6}","\\d{7}"]
 ,[,,"22\\d{5}","\\d{7}",,,"2221234"]
 ,[,,"9[89]\\d{5}","\\d{7}",,,"9812345"]
@@ -4717,7 +4769,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"UZ":[,[,,"[679]\\d{8}","\\d{7,9}"]
-,[,,"(?:6(?:1(?:22|3[124]|4[1-4]|5[123578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d{2}|7(?:[23]\\d|7[69]|)|9(?:4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[12456]|9[135-8])|1[12]\\d|2(?:22|3[1345789]|4[123579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-4579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}","\\d{7,9}",,,"662345678"]
+,[,,"(?:6(?:1(?:22|3[124]|4[1-4]|5[123578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d{2}|7(?:[23]\\d|7[69]|)|9(?:4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[12456]|9[135-8])|1[12]\\d|2(?:22|3[1345789]|4[123579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}","\\d{7,9}",,,"662345678"]
 ,[,,"6(?:1(?:2(?:98|2[01])|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:11\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4])|7\\d{2})|5(?:19[01]|2(?:27|9[26])|30\\d|59\\d|7\\d{2})|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|3[79]\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79])|9[0-3]\\d)|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(2(?:1[1267]|5\\d|3[01]|7[0-4])|5[67]\\d|6(?:2[0-26]|8\\d)|7\\d{2}))\\d{4}|7(?:0\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|33\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078])|9[4-6]\\d)|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0127]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[05629]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07])))\\d{4}|9[0-57-9]\\d{7}","\\d{7,9}",,,"912345678"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -4806,17 +4858,19 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"911","\\d{3}",,,"911"]
 ,[,,"NA","NA"]
 ]
-,"VN":[,[,,"8\\d{5,8}|[1-79]\\d{7,9}","\\d{7,10}"]
-,[,,"(?:2(?:[025-79]|1[0189]|[348][01])|3(?:[0136-9]|[25][01])|[48]\\d|5(?:[01][01]|[2-9])|6(?:[0-46-8]|5[01])|7(?:[02-79]|[18][01]))\\d{7}|69\\d{5,6}|80\\d{5}","\\d{7,10}",,,"2101234567"]
-,[,,"(?:9\\d|1(?:2\\d|6[3-9]|88|99))\\d{7}","\\d{9,10}",,,"912345678"]
+,"VN":[,[,,"[17]\\d{6,9}|[2-69]\\d{7,9}|8\\d{6,8}","\\d{7,10}"]
+,[,,"(?:2(?:[025-79]|1[0189]|[348][01])|3(?:[0136-9]|[25][01])|4\\d|5(?:[01][01]|[2-9])|6(?:[0-46-8]|5[01])|7(?:[02-79]|[18][01])|8[1-9])\\d{7}","\\d{9,10}",,,"2101234567"]
+,[,,"(?:9\\d|1(?:2\\d|6[3-9]|8[68]|99))\\d{7}","\\d{9,10}",,,"912345678"]
 ,[,,"1800\\d{4,6}","\\d{8,10}",,,"1800123456"]
 ,[,,"1900\\d{4,6}","\\d{8,10}",,,"1900123456"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"VN",84,"00","0",,,"0",,,,[[,"([48])(\\d{4})(\\d{4})","$1 $2 $3",["[48]"]
+,"VN",84,"00","0",,,"0",,,,[[,"([17]99)(\\d{4})","$1 $2",["[17]99"]
+,"0$1","",1]
+,[,"([48])(\\d{4})(\\d{4})","$1 $2 $3",["[48]"]
 ,"0$1","",1]
-,[,"([235-7]\\d)(\\d{4})(\\d{3})","$1 $2 $3",["2[025-79]|3[0136-9]|5[2-9]|6[0-46-9]|7[02-79]"]
+,[,"([235-7]\\d)(\\d{4})(\\d{3})","$1 $2 $3",["2[025-79]|3[0136-9]|5[2-9]|6[0-46-8]|7[02-79]"]
 ,"0$1","",1]
 ,[,"(80)(\\d{5})","$1 $2",["80"]
 ,"0$1","",1]
@@ -4826,14 +4880,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,"0$1","",1]
 ,[,"(9\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"]
 ,"0$1","",1]
-,[,"(1[2689]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[26]|88|99)"]
+,[,"(1[2689]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[26]|8[68]|99)"]
 ,"0$1","",1]
 ,[,"(1[89]00)(\\d{4,6})","$1 $2",["1[89]0"]
 ,"$1","",0]
 ]
 ,,[,,"NA","NA"]
-,,,[,,"NA","NA"]
-,[,,"NA","NA"]
+,,,[,,"[17]99\\d{4}|69\\d{5,6}","\\d{7,8}",,,"1992000"]
+,[,,"[17]99\\d{4}|69\\d{5,6}|80\\d{5}","\\d{7,8}",,,"1992000"]
 ,,[,,"11[345]","\\d{3}",,,"113"]
 ,[,,"NA","NA"]
 ]
index d482399..f829f17 100644 (file)
@@ -77,6 +77,7 @@ i18n.phonenumbers.metadata.countryCodeToRegionCodeMap = {
 ,94:["LK"]
 ,95:["MM"]
 ,98:["IR"]
+,211:["SS"]
 ,212:["MA"]
 ,213:["DZ"]
 ,216:["TN"]
@@ -184,7 +185,7 @@ i18n.phonenumbers.metadata.countryCodeToRegionCodeMap = {
 ,596:["MQ"]
 ,597:["SR"]
 ,598:["UY"]
-,599:["AN"]
+,599:["CW","AN","BQ"]
 ,670:["TL"]
 ,672:["NF"]
 ,673:["BN"]
@@ -248,8 +249,8 @@ i18n.phonenumbers.metadata.countryCodeToRegionCodeMap = {
  * @type {Object.<string, Array>}
  */
 i18n.phonenumbers.metadata.countryToMetadata = {
-"AC":[,[,,"[2-46]\\d{3}","\\d{4}"]
-,[,,"(?:3[0-5]|4[4-6]|[26]\\d)\\d{2}","\\d{4}"]
+"AC":[,[,,"[2-467]\\d{3}","\\d{4}"]
+,[,,"(?:3[0-5]|4[4-6]|[26]\\d|70)\\d{2}","\\d{4}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -371,15 +372,15 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"12[789]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"AM":[,[,,"[1-35-9]\\d{7}","\\d{5,8}"]
-,[,,"(?:10\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}","\\d{5,8}"]
+,"AM":[,[,,"[1-9]\\d{7}","\\d{5,8}"]
+,[,,"(?:10\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2|47\\d)\\d{5}","\\d{5,8}"]
 ,[,,"(?:55|77|9[1-9])\\d{6}","\\d{8}"]
 ,[,,"800\\d{5}","\\d{8}"]
 ,[,,"90[016]\\d{5}","\\d{8}"]
 ,[,,"80[1-4]\\d{5}","\\d{8}"]
 ,[,,"NA","NA"]
 ,[,,"6027\\d{4}","\\d{8}"]
-,"AM",374,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",["1"]
+,"AM",374,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{6})","$1 $2",["1|47"]
 ,"(0$1)","",0]
 ,[,"(\\d{2})(\\d{6})","$1 $2",["[5-7]|9[1-9]"]
 ,"0$1","",0]
@@ -394,20 +395,15 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"10[123]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"AN":[,[,,"[13-79]\\d{6,7}","\\d{7,8}"]
-,[,,"(?:318|5(?:25|4\\d|8[239])|7(?:1[578]|50)|9(?:[48]\\d{2}|50\\d|7(?:2[0-2]|[34]\\d|6[35-7]|77)))\\d{4}|416[0239]\\d{3}","\\d{7,8}"]
-,[,,"(?:318|5(?:1[01]|2[0-7]|5\\d|8[016-8])|7(?:0[01]|[89]\\d)|9(?:5(?:[1246]\\d|3[01])|6(?:[1679]\\d|3[01])))\\d{4}|416[15-8]\\d{3}","\\d{7,8}"]
+,"AN":[,[,,"5\\d{6}","\\d{7}"]
+,[,,"5(?:4\\d|8[239])\\d{4}","\\d{7}"]
+,[,,"5(?:1[01]|2[0-7]|5\\d|8[016-8])\\d{4}","\\d{7}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,[,,"(?:10|69)\\d{5}","\\d{7,8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"AN",599,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-7]"]
-,"","",0]
-,[,"(9)(\\d{3})(\\d{4})","$1 $2 $3",["9"]
-,"","",0]
-]
-,,[,,"NA","NA"]
+,[,,"NA","NA"]
+,"AN",599,"00",,,,,,,,,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,,[,,"112|911","\\d{3}"]
@@ -496,7 +492,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"AT":[,[,,"[1-9]\\d{3,12}","\\d{3,13}"]
-,[,,"1\\d{3,12}|(?:2(?:1[467]|2[134-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:12|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}","\\d{3,13}"]
+,[,,"1\\d{3,12}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-8]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|63|7[1368]|8[2457])|5(?:12|2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[1-35-8]|5[468]|62)|7(?:2[1-8]|3[25]|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{3,10}","\\d{3,13}"]
 ,[,,"6(?:44|5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}","\\d{7,13}"]
 ,[,,"80[02]\\d{6,10}","\\d{9,13}"]
 ,[,,"(?:711|9(?:0[01]|3[019]))\\d{6,10}","\\d{9,13}"]
@@ -572,14 +568,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,"AX",358,"00|99[049]","0",,,"0",,,,,,[,,"NA","NA"]
-,,,[,,"NA","NA"]
-,[,,"10[1-9]\\d{3,7}|2(?:0(?:[16-8]\\d{3,7}|2[14-9]\\d{1,6}|[3-5]\\d{2,7}|9[0-7]\\d{1,6})|9\\d{4,8})|30[1-9]\\d{3,7}|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}"]
+,,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}"]
+,[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}"]
 ,,[,,"112","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"AZ":[,[,,"[1-9]\\d{7,8}","\\d{5,9}"]
-,[,,"(?:1(?:(?:[28]\\d|9)\\d|02|1[0-589]|3[358]|4[013-79]|5[0-479]|6[02346-9]|7[0-24-8])|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)|365?\\d|44\\d{2})\\d{5}","\\d{5,9}"]
-,[,,"(?:[46]0|5[015]|7[07])\\d{7}","\\d{9}"]
+,"AZ":[,[,,"[1-9]\\d{8}","\\d{7,9}"]
+,[,,"(?:1[28]\\d|2(?:02|1[24]|2[2-4]|33|[45]2|6[23])|365)\\d{6}","\\d{7,9}"]
+,[,,"(?:4[04]|5[015]|60|7[07])\\d{7}","\\d{9}"]
 ,[,,"88\\d{7}","\\d{9}"]
 ,[,,"900200\\d{3}","\\d{9}"]
 ,[,,"NA","NA"]
@@ -587,12 +583,6 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,"AZ",994,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["(?:1[28]|2(?:[45]2|[0-36])|365)"]
 ,"(0$1)","",0]
-,[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["22"]
-,"(0$1)","",0]
-,[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["36[0-46-9]"]
-,"(0$1)","",0]
-,[,"(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[013-79]|2(?:[45][13-9]|[7-9])"]
-,"(0$1)","",0]
 ,[,"(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-8]"]
 ,"0$1","",0]
 ,[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"]
@@ -680,9 +670,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"1(?:0[01]|12)","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"BF":[,[,,"[2457]\\d{7}","\\d{8}"]
+,"BF":[,[,,"[24-7]\\d{7}","\\d{8}"]
 ,[,,"(?:20(?:49|5[23]|9[016-9])|40(?:4[569]|55|7[0179])|50[34]\\d)\\d{4}","\\d{8}"]
-,[,,"7(?:[02-68]\\d|1[0-4689]|7[0-6]|9[0-689])\\d{5}","\\d{8}"]
+,[,,"(?:6(?:0[0-3]|8\\d)|7(?:[02-68]\\d|1[0-4689]|7[0-69]|9[0-689]))\\d{5}","\\d{8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -769,7 +759,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
-,[,,"NA","NA"]
+,[,,"81\\d{6}","\\d{8}"]
 ,,[,,"11[78]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
@@ -836,30 +826,46 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"11[089]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"BR":[,[,,"[1-9]\\d{7,9}","\\d{8,10}"]
-,[,,"1[1-9][2-5]\\d{7}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}","\\d{8,10}"]
-,[,,"1(?:1(?:[6-9]\\d|5[347])|[2-9][6-9]\\d)\\d{6}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[6-9]\\d{7}","\\d{10}"]
-,[,,"800\\d{6,7}","\\d{8,10}"]
-,[,,"[359]00\\d{6,7}","\\d{8,10}"]
-,[,,"(?:400\\d|3003)\\d{4}","\\d{8}"]
+,"BQ":[,[,,"[347]\\d{6}","\\d{7}"]
+,[,,"(?:318[023]|416[0239]|7(?:1[578]|50)\\d)\\d{3}","\\d{7}"]
+,[,,"(?:318[1456]|416[15-8]|7(?:0[01]|[89]\\d)\\d)\\d{3}|","\\d{7}"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"BR",55,"00(?:1[45]|2[135]|[34]1|43)","0",,,"0(?:(1[245]|2[135]|[34]1)(\\d{10}))?","$2",,,[[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"]
+,"BQ",599,"00",,,,,,,,,,[,,"NA","NA"]
+,,,[,,"NA","NA"]
+,[,,"NA","NA"]
+,,[,,"112|911","\\d{3}"]
+,[,,"NA","NA"]
+]
+,"BR":[,[,,"[1-46-9]\\d{7,10}|5\\d{8,9}","\\d{8,11}"]
+,[,,"1[1-9][2-5]\\d{7}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}","\\d{8,11}"]
+,[,,"1(?:1(?:5[347]|[6-8]\\d|9\\d{1,2})|[2-9][6-9]\\d)\\d{6}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[6-9]\\d{7}","\\d{10,11}"]
+,[,,"800\\d{6,7}","\\d{8,11}"]
+,[,,"[359]00\\d{6,7}","\\d{8,11}"]
+,[,,"[34]00\\d{5}","\\d{8}"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,"BR",55,"00(?:1[45]|2[135]|[34]1|43)","0",,,"0(?:(1[245]|2[135]|[34]1)(\\d{10,11}))?","$2",,,[[,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["119"]
 ,"($1)","0 $CC ($1)",0]
-,[,"([34]00\\d)(\\d{4})","$1-$2",["[34]00","400|3003"]
+,[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"]
+,"($1)","0 $CC ($1)",0]
+,[,"([34]00\\d)(\\d{4})","$1-$2",["[34]00"]
 ,"","",0]
 ,[,"([3589]00)(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"]
 ,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
-,,,[,,"(?:400\\d|3003)\\d{4}","\\d{8}"]
+,,,[,,"[34]00\\d{5}","\\d{8}"]
 ,[,,"NA","NA"]
 ,,[,,"1(?:12|28|9[023])|911","\\d{3}"]
 ,[,,"NA","NA"]
 ]
 ,"BS":[,[,,"[2589]\\d{9}","\\d{7}(?:\\d{3})?"]
 ,[,,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[3467]|8[0-4]|9[2-467])|461|502|6(?:12|7[67]|8[78]|9[89])|702)\\d{4}","\\d{7}(?:\\d{3})?"]
-,[,,"242(?:3(?:5[79]|[79]5)|4(?:[2-4][1-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[34]|3[35]|44|5[1-9]|65|77)|6[34]6|727)\\d{4}","\\d{10}"]
+,[,,"242(?:3(?:5[79]|[79]5)|4(?:[2-4][1-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-9]|65|77)|6[34]6|727)\\d{4}","\\d{10}"]
 ,[,,"242300\\d{4}|8(?:00|55|66|77|88)[2-9]\\d{6}","\\d{10}"]
 ,[,,"900[2-9]\\d{6}","\\d{10}"]
 ,[,,"NA","NA"]
@@ -911,7 +917,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"99[789]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"BY":[,[,,"[12-4]\\d{8}|[89]\\d{9,10}","\\d{7,11}"]
+,"BY":[,[,,"[1-4]\\d{8}|[89]\\d{9,10}","\\d{7,11}"]
 ,[,,"(?:1(?:5(?:1[1-5]|2\\d|6[1-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d{2})|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:2\\d|3[02-79]|4[024-7]|5[0-7])))\\d{5}","\\d{7,9}"]
 ,[,,"(?:2(?:5[5679]|9[1-9])|33\\d|44\\d)\\d{6}","\\d{9}"]
 ,[,,"8(?:0[13]|20\\d)\\d{7}","\\d{10,11}"]
@@ -934,7 +940,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"BZ":[,[,,"[2-8]\\d{6}|0\\d{10}","\\d{7}(?:\\d{4})?"]
 ,[,,"[234578][02]\\d{5}","\\d{7}"]
-,[,,"6(?:[0-3]\\d|[67][01])\\d{4}","\\d{7}"]
+,[,,"6[0-367]\\d{5}","\\d{7}"]
 ,[,,"0800\\d{7}","\\d{11}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -1219,8 +1225,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"90[059]\\d{7}","\\d{10}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,[,,"40(?:00\\d{4}|10[0-3]\\d{3}|2(?:00\\d|900)\\d{2}|3[01]\\d{4}|5\\d{5})","\\d{8}"]
-,"CR",506,"00",,,,"(19(?:0[0-2]|19|77))",,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[24-7]|8[3-9]"]
+,[,,"210[0-6]\\d{4}|40(?:[04]0\\d{4}|10[0-3]\\d{3}|2(?:00\\d|900)\\d{2}|3[01]\\d{4}|5\\d{5}|70[01]\\d{3})|5100\\d{4}","\\d{8}"]
+,"CR",506,"00",,,,"(19(?:0[0-2468]|19|66|77))",,,,[[,"(\\d{4})(\\d{4})","$1 $2",["[24-7]|8[3-9]"]
 ,"","$CC $1",0]
 ,[,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]0"]
 ,"","$CC $1",0]
@@ -1249,7 +1255,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,,[,,"10[56]","\\d{3}"]
+,,[,,"10[456]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
 ,"CV":[,[,,"[259]\\d{6}","\\d{7}"]
@@ -1268,6 +1274,25 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"13[012]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
+,"CW":[,[,,"[169]\\d{6,7}","\\d{7,8}"]
+,[,,"9(?:[48]\\d{2}|50\\d|7(?:2[0-2]|[34]\\d|6[35-7]|77))\\d{4}","\\d{7,8}"]
+,[,,"9(?:5(?:[1246]\\d|3[01])|6(?:[1679]\\d|3[01]))\\d{4}","\\d{7,8}"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"(?:10|69)\\d{5}","\\d{7}"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,"CW",599,"00",,,,,,,,[[,"(\\d{3})(\\d{4})","$1 $2",["[13-7]"]
+,"","",0]
+,[,"(9)(\\d{3})(\\d{4})","$1 $2 $3",["9"]
+,"","",0]
+]
+,,[,,"955\\d{5}","\\d{7,8}"]
+,1,,[,,"NA","NA"]
+,[,,"NA","NA"]
+,,[,,"112|911","\\d{3}"]
+,[,,"NA","NA"]
+]
 ,"CY":[,[,,"[257-9]\\d{7}","\\d{8}"]
 ,[,,"2[2-6]\\d{6}","\\d{8}"]
 ,[,,"9[5-79]\\d{6}","\\d{8}"]
@@ -1334,24 +1359,32 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,"0$1","",0]
 ,[,"(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["(?:18|90)0","180|900[1359]"]
 ,"0$1","",0]
+,[,"(1\\d{2})(\\d{5,11})","$1 $2",["181"]
+,"0$1","",0]
+,[,"(18\\d{3})(\\d{6})","$1 $2",["18500"]
+,"0$1","",0]
+,[,"(18\\d{2})(\\d{7})","$1 $2",["18[68]"]
+,"0$1","",0]
+,[,"(18\\d)(\\d{8})","$1 $2",["18[2-579]"]
+,"0$1","",0]
 ,[,"(700)(\\d{4})(\\d{4})","$1 $2 $3",["700"]
 ,"0$1","",0]
 ]
 ,,[,,"16(?:4\\d{1,10}|[89]\\d{1,11})","\\d{4,14}"]
 ,,,[,,"NA","NA"]
-,[,,"NA","NA"]
+,[,,"18(?:1\\d{5,11}|[2-9]\\d{8})","\\d{8,14}"]
 ,,[,,"11[02]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"DJ":[,[,,"[1-8]\\d{5}","\\d{6}"]
-,[,,"(?:1[05]|[2-5]\\d)\\d{4}","\\d{6}"]
-,[,,"[6-8]\\d{5}","\\d{6}"]
+,"DJ":[,[,,"[27]\\d{7}","\\d{8}"]
+,[,,"2(?:1[2-5]|7[45]|)\\d{5}","\\d{8}"]
+,[,,"77[6-8]\\d{5}","\\d{8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"DJ",253,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",,"","",0]
+,"DJ",253,"00",,,,,,,,[[,"(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",,"","",0]
 ]
 ,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
@@ -1460,7 +1493,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,[,,"70[0-2]\\d{5}","\\d{8}"]
 ,[,,"NA","NA"]
-,"EE",372,"00",,,,,,,,[[,"([34-79]\\d{2})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]"]
+,"EE",372,"00",,,,,,,,[[,"([3-79]\\d{2})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]"]
 ,"","",0]
 ,[,"(70)(\\d{2})(\\d{4})","$1 $2 $3",["70"]
 ,"","",0]
@@ -1476,8 +1509,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"EG":[,[,,"1\\d{4,9}|[2456]\\d{8}|3\\d{7}|[89]\\d{8,9}","\\d{5,10}"]
-,[,,"(?:1[35][23]|2[23]\\d|3\\d|4(?:0[2-4]|[578][23]|64)|5(?:0[234]|[57][23])|6[24-689]3|8(?:[28][2-4]|42|6[23])|9(?:[25]2|3[24]|6[23]|7[2-4]))\\d{6}|1[69]\\d{3}","\\d{5,9}"]
-,[,,"1(?:[0-246-9]|5[0-2])\\d{7}|1(?:0[0169]|1[124]|2[0278])\\d{7}","\\d{9,10}"]
+,[,,"(?:1(3[23]\\d|5[23])|2[2-4]\\d{2}|3\\d{2}|4(?:0[2-5]|[578][23]|64)\\d|5(?:0[2-7]|[57][23])\\d|6[24-689]3\\d|8(?:2[2-57]|4[26]|6[237]|8[2-4])\\d|9(?:2[27]|3[24]|52|6[2356]|7[2-4])\\d)\\d{5}|1[69]\\d{3}","\\d{5,9}"]
+,[,,"1(?:[0-246-9]|5[0-2])\\d{7}|1(?:0[0169]|1[124]|2[0-278])\\d{7}","\\d{9,10}"]
 ,[,,"800\\d{7}","\\d{10}"]
 ,[,,"900\\d{7}","\\d{10}"]
 ,[,,"NA","NA"]
@@ -1485,11 +1518,11 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,"EG",20,"00","0",,,"0",,,,[[,"(\\d)(\\d{7,8})","$1 $2",["[23]"]
 ,"0$1","",0]
-,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:0[0169]|1[124]|2[0278]|5[0-2])|[89]00"]
+,[,"(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:0[0169]|1[124]|2[0-278]|5[0-2])|[89]00"]
 ,"0$1","",0]
 ,[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[0-246-9]|5[3-9])"]
 ,"0$1","",0]
-,[,"(\\d{2})(\\d{7})","$1 $2",["13|[4-6]|[89][2-9]"]
+,[,"(\\d{2})(\\d{6,7})","$1 $2",["1(?:3|5[23])|[4-6]|[89][2-9]"]
 ,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
@@ -1531,7 +1564,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"ET":[,[,,"[1-59]\\d{8}","\\d{7,9}"]
-,[,,"(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-23]|6[5-8])|5(?:1[57]|44|5[0-4])|6(?:18|2[69]|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|22[0-6]|33[0134689]|44[04]|55[0-6]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:11[1-9]|22[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}","\\d{7,9}"]
+,[,,"(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[57]|44|5[0-4])|6(?:18|2[69]|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|22[0-6]|33[0134689]|44[04]|55[0-6]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:11[1-9]|22[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}","\\d{7,9}"]
 ,[,,"9[12]\\d{7}","\\d{9}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -1554,16 +1587,16 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"FI",358,"00|99[049]","0",,,"0",,,,[[,"(\\d{2})(\\d{4,10})","$1 $2",["2[09]|[14]|50|7[135]"]
+,"FI",358,"00|99[049]","0",,,"0",,,,[[,"(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]00|[6-8]0)"]
 ,"0$1","",0]
-,[,"(\\d)(\\d{4,11})","$1 $2",["[25689][1-8]|3"]
+,[,"(\\d{2})(\\d{4,10})","$1 $2",["2[09]|[14]|50|7[135]"]
 ,"0$1","",0]
-,[,"([6-8]00)(\\d{4,7})","$1 $2",["[6-8]0"]
+,[,"(\\d)(\\d{4,11})","$1 $2",["[25689][1-8]|3"]
 ,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
-,1,,[,,"NA","NA"]
-,[,,"10[1-9]\\d{3,7}|2(?:0(?:[16-8]\\d{3,7}|2[14-9]\\d{1,6}|[3-5]\\d{2,7}|9[0-7]\\d{1,6})|9\\d{4,8})|30[1-9]\\d{3,7}|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}"]
+,1,,[,,"[13]00\\d{3,7}|2(?:0(?:0\\d{3,7}|2[023]\\d{1,6}|9[89]\\d{1,6}))|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}"]
+,[,,"[13]0\\d{4,8}|2(?:0(?:[016-8]\\d{3,7}|[2-59]\\d{2,7})|9\\d{4,8})|60(?:[12]\\d{5,6}|6\\d{7})|7(?:1\\d{7}|3\\d{8}|5[03-9]\\d{2,7})","\\d{5,10}"]
 ,,[,,"112","\\d{3}"]
 ,[,,"NA","NA"]
 ]
@@ -1653,7 +1686,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"GA":[,[,,"[12]\\d{6}|0\\d{7}","\\d{6,8}"]
 ,[,,"(?:1(?:4[4-8]|7\\d)|2(?:4[02]|5[04-689]|6[024-79]|8[236]|9[02368]))\\d{4}","\\d{6,7}"]
-,[,,"0(?:5(?:0[89]|3[0-4]|8[0-26]|9[238])|6(?:0[3-7]|1[01]|2[0-7]|6[0-589]|71|83|9[57])|7(?:1[2-5]|2[89]|3[35-9]|4[01]|5[0-347-9]|[67]\\d|8[457-9]|9[0146]))\\d{4}","\\d{8}"]
+,[,,"0(?:5(?:0[89]|3[0-4]|8[0-26]|9[238])|6(?:0[3-7]|1[01]|2[0-7]|6[0-589]|71|83|9[57])|7(?:1[2-5]|2[89]|3[35-9]|4[01]|5[0-47-9]|[67]\\d|8[457-9]|9[0146]))\\d{4}","\\d{8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -1768,18 +1801,21 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"112|999","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"GH":[,[,,"[235]\\d{6,8}","\\d{7,9}"]
+,"GH":[,[,,"[235]\\d{8}|8\\d{7}","\\d{7,9}"]
 ,[,,"3(?:0[237]\\d|[167](?:2[0-6]|7\\d)|2(?:2[0-5]|7\\d)|3(?:2[0-37]|7\\d)|4(?:[27]\\d|30)|5(?:2[0-7]|7\\d)|8(?:2[0-2]|7\\d)|9(?:20|7\\d))\\d{5}","\\d{7,9}"]
 ,[,,"(?:2[034678]|5[47])\\d{7}","\\d{9}"]
+,[,,"800\\d{5}","\\d{8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,[,,"NA","NA"]
-,"GH",233,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",,"0$1","",0]
+,"GH",233,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"]
+,"0$1","",0]
+,[,"(\\d{3})(\\d{5})","$1 $2",["8"]
+,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
-,,,[,,"NA","NA"]
+,,,[,,"800\\d{5}","\\d{8}"]
 ,[,,"NA","NA"]
 ,,[,,"19[123]|999","\\d{3}"]
 ,[,,"NA","NA"]
@@ -1969,7 +2005,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"HK":[,[,,"[235-7]\\d{7}|8\\d{7,8}|9\\d{7,10}","\\d{8,11}"]
 ,[,,"[23]\\d{7}","\\d{8}"]
-,[,,"[5-79]\\d{7}","\\d{8}"]
+,[,,"[569]\\d{7}","\\d{8}"]
 ,[,,"800\\d{6}","\\d{9}"]
 ,[,,"900\\d{8}","\\d{11}"]
 ,[,,"NA","NA"]
@@ -1982,14 +2018,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,"(900)(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["900"]
 ,"","",0]
 ]
-,,[,,"NA","NA"]
+,,[,,"7\\d{7}","\\d{8}"]
 ,,,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,,[,,"112|99[29]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
 ,"HN":[,[,,"[237-9]\\d{7}","\\d{8}"]
-,[,,"2(?:2(?:0[019]|1[1-36]|[23]\\d|4[056]|5[57]|9[01])|4(?:2|3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:4[3-5]|5\\d|6[56]|74)|6(?:4[0-378]|[56]\\d|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[34])|8(?:79|8[0-35789]|9[1-57-9]))\\d{4}","\\d{8}"]
+,[,,"2(?:2(?:0[019]|1[1-36]|[23]\\d|4[056]|5[57]|8[0146-9]|9[012])|4(?:2|3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:4[3-5]|5\\d|6[56]|74)|6(?:4[0-378]|[56]\\d|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[34])|8(?:79|8[0-35789]|9[1-57-9]))\\d{4}","\\d{8}"]
 ,[,,"[37-9]\\d{7}","\\d{8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -2075,8 +2111,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"ID":[,[,,"[1-9]\\d{6,10}","\\d{5,11}"]
-,[,,"2[124]\\d{7,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|2[1-578]|3[1-68]|4[1-3]|5[1-8]|6[1-3568]|7[0-46]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[1246-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:19?|[25]\\d|3[1-469]|4[1-6])|7(?:1[1-46-9]|2[14-9]|[36]\\d|4[1-8]|5[1-9]|7[0-36-9])|9(?:0[12]|1[0134-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}","\\d{5,10}"]
-,[,,"8[1-35-9]\\d{7,9}","\\d{9,11}"]
+,[,,"2(?:1(?:[0-8]\\d{6,7}|9\\d{6})|[24]\\d{7,8})|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|2[1-578]|3[1-68]|4[1-3]|5[1-8]|6[1-3568]|7[0-46]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[1246-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:19?|[25]\\d|3[1-469]|4[1-6])|7(?:1[1-46-9]|2[14-9]|[36]\\d|4[1-8]|5[1-9]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}","\\d{5,10}"]
+,[,,"(?: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}","\\d{9,11}"]
 ,[,,"177\\d{6,8}|800\\d{5,7}","\\d{8,11}"]
 ,[,,"809\\d{7}","\\d{10}"]
 ,[,,"NA","NA"]
@@ -2180,14 +2216,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"IN":[,[,,"1\\d{7,12}|[2-9]\\d{9,10}","\\d{6,13}"]
-,[,,"(?: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}","\\d{6,10}"]
-,[,,"(?: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[245789]|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[235-8]|4[14789]|74|90)|4(?:[02-58]\\d|10|6[09])|5(?:0[079]|11|2\\d|30|4[47]|53|7[45]|9[015])|6(?:[0589]\\d|7[09])|7(?:1[24]|[2569]\\d)|8(?:[07-9]\\d|17|2[024-8]|44|5[389]|6[0167])|9(?:[057-9]\\d|2[35-9]|3[09]|4[036-8]|6[0-46-9]))|9\\d{3})\\d{6}","\\d{10}"]
+,[,,"(?:11|2[02]|33|4[04]|79)[2-7]\\d{7}|80[2-467]\\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-7]\\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]|[57][2-689]|6[24-58]|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-7]\\d{5}","\\d{6,10}"]
+,[,,"(?: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}","\\d{10}"]
 ,[,,"1(?:600\\d{6}|80(?:0\\d{4,8}|3\\d{9}))","\\d{8,13}"]
 ,[,,"186[12]\\d{9}","\\d{13}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"IN",91,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{2})(\\d{6})","$1 $2 $3",["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-579]6[05789]7[12569]|8[0124-9]|9[02-9])|9","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[245789]|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[235-8]|4[14789]|74|90)|4(?:[02-58]|10|6[09])|5(?:0[079]|11|2|30|4[47]|53|7[45]|9[015])|6(?:[0589]|70)|7(?:1[24]|[2569])|8(?:[07-9]|17|2[024-8]|44|5[389]|6[0167])|9(?:[057-9]|2[35-9]|3[09]|4[03678]|6[0-46-9]))|9"]
+,"IN",91,"00","0",,,"0",,,,[[,"(\\d{2})(\\d{2})(\\d{6})","$1 $2 $3",["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","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"]
 ,"0$1","",1]
 ,[,"(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79|80[2-46]"]
 ,"0$1","",1]
@@ -2401,9 +2437,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,"0$1","",0]
 ,[,"(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|5(?:76|97)|499|746|8(?:3[89]|63|47|51)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:76|97)9|499[2468]|7468|8(?:3(?:8[78]|96)|636|477|51[24])|9(?:496|802|9(?:1[23]|69))","1(?:267|3(?:7[247]|9[278])|4(?:5[67]|66)|5(?:47|58|64|8[67])|6(?:3[245]|48|5[4-68]))|5(?:769|979[2-69])|499[2468]|7468|8(?:3(?:8[78]|96[2457-9])|636[2-57-9]|477|51[24])|9(?:496|802|9(?:1[23]|69))"]
 ,"0$1","",0]
-,[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[034-9]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[0245-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-56]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[0245-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[0245-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[0245-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"]
+,[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["1(?:2[3-6]|3[3-9]|4[2-6]|5[2-8]|[68][2-7]|7[2-689]|9[1-578])|2(?:2[03-9]|3[3-58]|4[0-468]|5[04-8]|6[013-8]|7[06-9]|8[02-57-9]|9[13])|4(?:2[28]|3[689]|6[035-7]|7[05689]|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9[4-9])|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9[014-9])|8(?:2[49]|3[3-8]|4[5-8]|5[2-9]|6[35-9]|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9[3-7])","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9[2-8])|3(?:7[2-6]|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5[4-7]|6[2-9]|8[2-8]|9[236-9])|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3[34]|[4-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6[56]))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))","1(?:2[3-6]|3[3-9]|4[2-6]|5(?:[236-8]|[45][2-69])|[68][2-7]|7[2-689]|9[1-578])|2(?:2(?:[04-9]|3[23])|3[3-58]|4[0-468]|5(?:5[78]|7[2-4]|[0468][2-9])|6(?:[0135-8]|4[2-5])|7(?:[0679]|8[2-7])|8(?:[024578]|3[25-9]|9[6-9])|9(?:11|3[2-4]))|4(?:2(?:2[2-9]|8[237-9])|3[689]|6[035-7]|7(?:[059][2-8]|[68])|80|9[3-5])|5(?:3[1-36-9]|4[4578]|5[013-8]|6[1-9]|7[2-8]|8[14-7]|9(?:[89][2-8]|[4-7]))|7(?:2[15]|3[5-9]|4[02-9]|6[135-8]|7[0-4689]|9(?:[017-9]|4[6-8]|5[2-478]|6[2-589]))|8(?:2(?:4[4-8]|9(?:[3578]|20|4[04-9]|6(?:5[25]|60)))|3(?:7(?:[2-5]|6[0-59])|[3-6][2-9]|8[2-5])|4[5-8]|5[2-9]|6(?:[37]|5(?:[467]|5[014-9])|6(?:[2-8]|9[02-69])|8[2-8]|9(?:[236-8]|9[23]))|7[579]|8[03-579]|9[2-8])|9(?:[23]0|4[02-46-9]|5[024-79]|6[4-9]|7[2-47-9]|8[02-7]|9(?:3(?:3[02-9]|4[0-24689])|4[2-69]|[5-7]))"]
 ,"0$1","",0]
-,[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:23|5[5-89]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:23|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:23|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"]
+,[,"(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1|2(?:23|5[5-9]|64|78|8[39]|91)|4(?:2[2689]|64|7[347])|5(?:[2-589]|39)|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93)","1|2(?:23|5(?:[57]|[68]0|9[19])|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93[34])","1|2(?:23|5(?:[57]|[68]0|9(?:17|99))|64|78|8[39]|917)|4(?:2(?:[68]|20|9[178])|64|7[347])|5(?:[2-589]|39[67])|60|8(?:[46-9]|3[279]|2[124589])|9(?:[235-8]|93(?:31|4))"]
 ,"0$1","",0]
 ,[,"(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["2(?:9[14-79]|74|[34]7|[56]9)|82|993"]
 ,"0$1","",0]
@@ -2418,11 +2454,11 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,1,[,,"11[09]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"KE":[,[,,"20\\d{4,7}|[4-9]\\d{5,9}","\\d{4,10}"]
-,[,,"(?:20|4[0-6]|5\\d|6[0-24-9])\\d{4,7}","\\d{4,9}"]
-,[,,"7(?:0[0-5]|[123]\\d|5[0-4]|7[0-5]|8[6-9])\\d{6}","\\d{9}"]
-,[,,"800[245-8]\\d{5,6}","\\d{9,10}"]
-,[,,"9(?:00[2-578]|11\\d)\\d{5}","\\d{9}"]
+,"KE":[,[,,"20\\d{6,7}|[4-9]\\d{6,9}","\\d{5,10}"]
+,[,,"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})","\\d{5,9}"]
+,[,,"7(?:0[0-8]|[123]\\d|5[0-5]|7[0-5]|8[5-9])\\d{6}","\\d{9}"]
+,[,,"800[24-8]\\d{5,6}","\\d{9,10}"]
+,[,,"900[02-578]\\d{5}","\\d{9}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -2439,7 +2475,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"112|999","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"KG":[,[,,"[356-8]\\d{8,9}","\\d{5,10}"]
+,"KG":[,[,,"[35-8]\\d{8,9}","\\d{5,10}"]
 ,[,,"(?:3(?:1(?:2\\d|3[1-9]|47|5[02]|6[1-8])|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6[0-4])|5(?:22|3[4-7]|59|6[0-5])|6(?:22|5[35-7]|6[0-3])|7(?:22|3[468]|4[1-9]|59|6\\d|7[5-7])|9(?:22|4[1-8]|6[0-8]))|6(?:09|12|2[2-4])\\d)\\d{5}","\\d{5,10}"]
 ,[,,"5[124-7]\\d{7}|7(?:0[0-357-9]|7\\d)\\d{6}","\\d{9}"]
 ,[,,"800\\d{6,7}","\\d{9,10}"]
@@ -2462,7 +2498,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"KH":[,[,,"[1-9]\\d{7,9}","\\d{6,10}"]
 ,[,,"(?:2[3-6]|3[2-6]|4[2-4]|[567][2-5])[2-46-9]\\d{5}","\\d{6,8}"]
-,[,,"(?:(?:1[0-35-9]|6[6-9]|7[06-89])[1-9]|8(?:0[89]|5[2-689]|8\\d{2}|[13469]\\d|)|9(?:[0-689][1-9]|7[1-9]\\d?))\\d{5}","\\d{8,9}"]
+,[,,"(?:(?:1[0-35-9]|6[6-9]|7[06-9])[1-9]|8(?:0[89]|5[2-689]|8\\d{2}|[13469]\\d|)|9(?:[0-689][1-9]|7[1-9]\\d?))\\d{5}","\\d{8,9}"]
 ,[,,"1800(?:1\\d|2[019])\\d{4}","\\d{10}"]
 ,[,,"1900(?:1\\d|2[09])\\d{4}","\\d{10}"]
 ,[,,"NA","NA"]
@@ -2552,7 +2588,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,[,,"50\\d{8}","\\d{10}"]
 ,[,,"70\\d{8}","\\d{10}"]
-,"KR",82,"00(?:[124-68]|[37]\\d{2})","0",,,"0(8[1-46-8]|85\\d{2})?",,,,[[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"]
+,"KR",82,"00(?:[124-68]|[37]\\d{2})","0",,,"0(8[1-46-8]|85\\d{2})?",,,,[[,"(\\d{3})","$1",["11[29]"]
+,"$1","0$CC-$1",0]
+,[,"(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["1(?:0|1[19]|[69]9|5[458])|[57]0","1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0"]
 ,"0$1","0$CC-$1",0]
 ,[,"(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][2-9]","1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-6][1-9][2-9]"]
 ,"0$1","0$CC-$1",0]
@@ -2581,7 +2619,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"KW":[,[,,"[12569]\\d{6,7}|65816\\d{6}","\\d{7,8}|\\d{11}"]
 ,[,,"(?:18\\d|2(?:[23]\\d{2}|4[1-35-9]\\d|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7])))\\d{4}","\\d{7,8}"]
-,[,,"(?:5(?:0[0-26]|5\\d)|6(?:0[034679]|5(?:[015-79]|8(?:[02-9]|1[0-57-9]))|6\\d|7[067]|9[69])|9(?:0[09]|4[049]|66|[79]\\d))\\d{5}","\\d{8}"]
+,[,,"(?:5(?:0[0-2568]|5\\d)|6(?:0[034679]|5(?:[015-79]|8(?:[02-9]|1[0-57-9]))|6\\d|7[067]|9[69])|9(?:0[09]|4[049]|66|[79]\\d))\\d{5}","\\d{8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -2601,14 +2639,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"65816\\d{6}","\\d{11}"]
 ]
 ,"KY":[,[,,"[3589]\\d{9}","\\d{7}(?:\\d{3})?"]
-,[,,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:6[6-9]|77)|8(?:00|1[45]|25|4[89]|88)|9(?:14|4[035-9]))\\d{4}","\\d{7}(?:\\d{3})?"]
-,[,,"345(?:32[3-79]|5(?:1[467]|2[5-7]|4[5-9])|9(?:1[679]|2[4-9]|3[89]))\\d{4}","\\d{10}"]
+,[,,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}","\\d{7}(?:\\d{3})?"]
+,[,,"345(?:32[1-9]|5(?:1[67]|2[5-7]|4[6-8]|76)|9(?:1[67]|2[3-9]|3[689]))\\d{4}","\\d{10}"]
 ,[,,"8(?:00|55|66|77|88)[2-9]\\d{6}","\\d{10}"]
 ,[,,"900[2-9]\\d{6}|345976\\d{4}","\\d{10}"]
 ,[,,"NA","NA"]
 ,[,,"5(?:00|33|44)[2-9]\\d{6}","\\d{10}"]
 ,[,,"NA","NA"]
-,"KY",1,"011","1",,,"1",,,,,,[,,"NA","NA"]
+,"KY",1,"011","1",,,"1",,,,,,[,,"345849\\d{4}","\\d{10}"]
 ,,"345",[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,,[,,"911","\\d{3}"]
@@ -2649,7 +2687,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"LB":[,[,,"[13-9]\\d{6,7}","\\d{7,8}"]
 ,[,,"(?:[14-6]\\d{2}|7(?:[2-57-9]\\d|62)|[89][2-9]\\d)\\d{4}","\\d{7}"]
-,[,,"(?:3\\d|7(?:[01]\\d|6[01346-9]))\\d{5}","\\d{7,8}"]
+,[,,"(?:3\\d|7(?:[01]\\d|6[013-9]))\\d{5}","\\d{7,8}"]
 ,[,,"NA","NA"]
 ,[,,"9[01]\\d{6}","\\d{8}"]
 ,[,,"8[01]\\d{6}","\\d{8}"]
@@ -2657,7 +2695,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,"LB",961,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-6]|7(?:[2-57-9]|62)|[89][2-9]"]
 ,"0$1","",0]
-,[,"([7-9]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89][01]|7(?:[01]|6[01346-9])"]
+,[,"([7-9]\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89][01]|7(?:[01]|6[013-9])"]
 ,"","",0]
 ]
 ,,[,,"NA","NA"]
@@ -2792,9 +2830,9 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"801\\d{5}","\\d{8}"]
 ,[,,"70\\d{6}","\\d{8}"]
 ,[,,"20\\d{2,8}","\\d{4,10}"]
-,"LU",352,"00",,,,"(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)",,,,[[,"(\\d{2})(\\d{3})","$1 $2",["[23-5]|7[1-9]|[89](?:[1-9]|0[2-9])"]
+,"LU",352,"00",,,,"(15(?:0[06]|1[12]|35|4[04]|55|6[26]|77|88|99)\\d)",,,,[[,"(\\d{2})(\\d{3})","$1 $2",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"]
 ,"","$CC $1",0]
-,[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[23-5]|7[1-9]|[89](?:[1-9]|0[2-9])"]
+,[,"(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-5]|7[1-9]|[89](?:[1-9]|0[2-9])"]
 ,"","$CC $1",0]
 ,[,"(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20"]
 ,"","$CC $1",0]
@@ -2818,11 +2856,11 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"LV":[,[,,"[2689]\\d{7}","\\d{8}"]
-,[,,"6\\d{7}","\\d{8}"]
+,[,,"6[3-8]\\d{6}","\\d{8}"]
 ,[,,"2\\d{7}","\\d{8}"]
 ,[,,"80\\d{6}","\\d{8}"]
 ,[,,"90\\d{6}","\\d{8}"]
-,[,,"NA","NA"]
+,[,,"81\\d{6}","\\d{8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,"LV",371,"00",,,,,,,,[[,"([2689]\\d)(\\d{3})(\\d{3})","$1 $2 $3",,"","",0]
@@ -2851,7 +2889,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"MA":[,[,,"[5689]\\d{8}","\\d{9}"]
 ,[,,"5(?:2(?:(?:[015-7]\\d|2[2-9]|3[2-57]|4[2-8]|8[235-9]|)\\d|9(?:0\\d|[89]0))|3(?:(?:[0-4]\\d|[57][2-9]|6[235-8]|9[3-9])\\d|8(?:0\\d|[89]0)))\\d{4}","\\d{9}"]
-,[,,"6(?:0[0-36]|[14-7]\\d|2[236]|3[348]|99)\\d{6}","\\d{9}"]
+,[,,"6(?:0[0-6]|[14-7]\\d|2[23679]|3[03458]|80|99)\\d{6}","\\d{9}"]
 ,[,,"80\\d{7}","\\d{9}"]
 ,[,,"89\\d{7}","\\d{9}"]
 ,[,,"NA","NA"]
@@ -2893,7 +2931,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"1(?:12|[578])","\\d{2,3}"]
 ,[,,"NA","NA"]
 ]
-,"MD":[,[,,"[256-9]\\d{7}","\\d{8}"]
+,"MD":[,[,,"[25-9]\\d{7}","\\d{8}"]
 ,[,,"(?:2(?:1[0569]|2\\d|3[015-7]|4[1-46-9]|5[0-24689]|6[2-589]|7[1-37]|9[1347-9])|5(?:33|5[257]))\\d{5}","\\d{5,8}"]
 ,[,,"(?:562|6(?:50|7[1-4]|[089]\\d)|7(?:7[47-9]|[89]\\d))\\d{5}","\\d{8}"]
 ,[,,"800\\d{5}","\\d{8}"]
@@ -2980,7 +3018,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"MK":[,[,,"[2-578]\\d{7}","\\d{8}"]
-,[,,"(?:2(?:[23]\\d|5[125]|61)|3(?:1[3-6]|2[2-6]|3[2-5]|4[235])|4(?:[23][2-6]|4[3-6]|5[25]|6[25-8]|7[24-6]|8[4-6]))\\d{5}","\\d{6,8}"]
+,[,,"(?:2(?:[23]\\d|5[125]|6[01])|3(?:1[3-6]|2[2-6]|3[2-5]|4[235])|4(?:[23][2-6]|4[3-6]|5[25]|6[25-8]|7[24-6]|8[4-6]))\\d{5}","\\d{6,8}"]
 ,[,,"7[0-25-8]\\d{6}","\\d{8}"]
 ,[,,"800\\d{5}","\\d{8}"]
 ,[,,"5[02-9]\\d{6}","\\d{8}"]
@@ -3195,22 +3233,20 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"1(?:02|19)","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"MW":[,[,,"(?:[3-5]|[27]\\d{2}|[189](?:\\d{2})?)\\d{6}","\\d{7,9}"]
+,"MW":[,[,,"(?:1(?:\\d{2})?|[2789]\\d{2})\\d{6}","\\d{7,9}"]
 ,[,,"(?:1[2-9]|21\\d{2})\\d{5}","\\d{7,9}"]
-,[,,"(?:111|[3-5]|77\\d|8(?:8\\d)?|9(?:9\\d)?)\\d{6}","\\d{7,9}"]
+,[,,"(?:111|77\\d|88\\d|99\\d)\\d{6}","\\d{9}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"MW",265,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-5]"]
+,"MW",265,"00","0",,,"0",,,,[[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1"]
 ,"0$1","",0]
 ,[,"(2\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"]
 ,"0$1","",0]
 ,[,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1789]"]
 ,"0$1","",0]
-,[,"(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[89]"]
-,"0$1","",0]
 ]
 ,,[,,"NA","NA"]
 ,,,[,,"NA","NA"]
@@ -3297,7 +3333,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"NA":[,[,,"[68]\\d{7,8}","\\d{8,9}"]
-,[,,"6(?:1(?:17|2(?:[0189]\\d|[23-6]|7\\d?)|3(?:2\\d|3[378])|4[01]|69|7[014])|2(?:17|25|5(?:[0-36-8]|4\\d?)|69|70)|3(?:17|2(?:[0237]\\d?|[14-689])|34|6[29]|7[01]|81)|4(?:17|2(?:[012]|7?)|4(?:[06]|1\\d)|5(?:[01357]|[25]\\d?)|69|7[01])|5(?:17|2(?:[0459]|[23678]\\d?)|69|7[01])|6(?:17|2(?:5|6\\d?)|38|42|69|7[01])|7(?:17|2(?:[569]|[234]\\d?)|3(?:0\\d?|[13])|69|7[01]))\\d{4}","\\d{8,9}"]
+,[,,"6(?:1(?:17|2(?:[0189]\\d|[2-6]|7\\d?)|3(?:2\\d|3[378])|4[01]|69|7[014])|2(?:17|25|5(?:[0-36-8]|4\\d?)|69|70)|3(?:17|2(?:[0237]\\d?|[14-689])|34|6[29]|7[01]|81)|4(?:17|2(?:[012]|7?)|4(?:[06]|1\\d)|5(?:[01357]|[25]\\d?)|69|7[01])|5(?:17|2(?:[0459]|[23678]\\d?)|69|7[01])|6(?:17|2(?:5|6\\d?)|38|42|69|7[01])|7(?:17|2(?:[569]|[234]\\d?)|3(?:0\\d?|[13])|69|7[01]))\\d{4}","\\d{8,9}"]
 ,[,,"(?:60|8[125])\\d{7}","\\d{9}"]
 ,[,,"NA","NA"]
 ,[,,"8701\\d{5}","\\d{9}"]
@@ -3337,7 +3373,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"NE":[,[,,"[029]\\d{7}","\\d{8}"]
 ,[,,"2(?:0(?:20|3[1-7]|4[134]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}","\\d{8}"]
-,[,,"9[0134678]\\d{6}","\\d{8}"]
+,[,,"9[0-46-9]\\d{6}","\\d{8}"]
 ,[,,"08\\d{6}","\\d{8}"]
 ,[,,"09\\d{6}","\\d{8}"]
 ,[,,"NA","NA"]
@@ -3515,7 +3551,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"NZ":[,[,,"6[235-9]\\d{6}|[2-57-9]\\d{7,10}","\\d{7,11}"]
 ,[,,"(?:3[2-79]|[49][2-689]|6[235-9]|7[2-589])\\d{6}|24099\\d{3}","\\d{7,8}"]
-,[,,"2(?:[079]\\d{7}|1(?:0\\d{5,7}|[12]\\d{5,6}|[3-9]\\d{5})|[28]\\d{7,8}|4[1-9]\\d{6})","\\d{8,10}"]
+,[,,"2(?:[028]\\d{7,8}|1(?:0\\d{5,7}|[12]\\d{5,6}|[3-9]\\d{5})|[79]\\d{7})","\\d{8,10}"]
 ,[,,"508\\d{6,7}|80\\d{6,8}","\\d{8,10}"]
 ,[,,"90\\d{7,9}","\\d{9,11}"]
 ,[,,"NA","NA"]
@@ -3523,15 +3559,15 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ,"NZ",64,"0(?:0|161)","0",,,"0",,"00",,[[,"([34679])(\\d{3})(\\d{4})","$1-$2 $3",["[3467]|9[1-9]"]
 ,"0$1","",0]
-,[,"(21)(\\d{4})(\\d{3,4})","$1 $2 $3",["21"]
+,[,"(24099)(\\d{3})","$1 $2",["240","2409","24099"]
 ,"0$1","",0]
-,[,"(22)(\\d{3})(\\d{4})","$1 $2 $3",["22"]
+,[,"(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["21"]
 ,"0$1","",0]
-,[,"([2589]\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[0247-9]|5|[89]00"]
+,[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[1-9]|[69]|7[0-35-9])|86"]
 ,"0$1","",0]
-,[,"(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[0169]|86"]
+,[,"(2\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["2[028]"]
 ,"0$1","",0]
-,[,"(24099)(\\d{3})","$1 $2",["240","2409","24099"]
+,[,"(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|5|[89]0"]
 ,"0$1","",0]
 ]
 ,,[,,"[28]6\\d{6,7}","\\d{8,9}"]
@@ -3885,8 +3921,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"112","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"RS":[,[,,"[1-36-9]\\d{4,11}","\\d{5,12}"]
-,[,,"[1-3]\\d{6,11}","\\d{5,12}"]
+,"RS":[,[,,"[126-9]\\d{4,11}|3(?:[0-79]\\d{3,10}|8[2-9]\\d{2,9})","\\d{5,12}"]
+,[,,"(?:1(?:[02-9][2-9]|1[1-9])\\d|2(?:[0-24-7][2-9]\\d|[389](?:0[2-9]|[2-9]\\d))|3(?:[0-8][2-9]\\d|9(?:[2-9]\\d|0[2-9])))\\d{3,8}","\\d{5,12}"]
 ,[,,"6(?:[0-689]|7\\d)\\d{6,7}","\\d{8,10}"]
 ,[,,"800\\d{3,9}","\\d{6,12}"]
 ,[,,"(?:90[0169]|78\\d)\\d{3,7}","\\d{6,12}"]
@@ -3953,7 +3989,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"SA":[,[,,"[1-467]\\d{7}|5\\d{8}|(?:8|92)\\d{9}","\\d{7,11}"]
-,[,,"(?:[12][24-8]|3[35-8]|4[34-68]|6[2-5]|7[235-7])\\d{6}","\\d{7,8}"]
+,[,,"(?:[12][24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}","\\d{7,8}"]
 ,[,,"(?:5[013-689]\\d|8111)\\d{6}","\\d{9,10}"]
 ,[,,"800\\d{7}","\\d{10}"]
 ,[,,"9200\\d{7}","\\d{11}"]
@@ -3979,7 +4015,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"SB":[,[,,"[1-8]\\d{4,6}","\\d{5,7}"]
 ,[,,"(?:1[4-79]|[23]\\d|4[01]|5[03]|6[0-37])\\d{3}","\\d{5}"]
-,[,,"7(?:4\\d|5[025-8]|6[01])\\d{4}|8[4-8]\\d{5}","\\d{7}"]
+,[,,"48\\d{3}|7(?:4\\d|5[025-8]|6[0-4])\\d{4}|8[4-8]\\d{5}","\\d{5,7}"]
 ,[,,"1[38]\\d{3}","\\d{5}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -3995,8 +4031,8 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"SC":[,[,,"[24689]\\d{5,6}","\\d{6,7}"]
-,[,,"(?:2(?:55[0-5]|78[013])|4(?:2(?:0[589]|1[03-9]|[2-9]\\d)|[346]\\d{2}))\\d{3}","\\d{7}"]
-,[,,"2(?:5(?:[0-46-9]\\d|5[6-9])|7(?:[0-79]\\d|8[24-9]))\\d{3}","\\d{7}"]
+,[,,"4[2-46]\\d{5}","\\d{7}"]
+,[,,"2[5-8]\\d{5}","\\d{7}"]
 ,[,,"8000\\d{2}","\\d{6}"]
 ,[,,"98\\d{4}","\\d{6}"]
 ,[,,"NA","NA"]
@@ -4030,7 +4066,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"SE":[,[,,"[1-9]\\d{6,9}","\\d{5,10}"]
-,[,,"1(?:0[1-8]\\d{6}|[136]\\d{5,7}|(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)\\d{5,6})|2(?:[136]\\d{5,7}|(?:2[0-7]|4[0136-8]|5[0-38]|7[018]|8[01]|9[0-57])\\d{5,6})|3(?:[356]\\d{5,7}|(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])\\d{5,6})|4(?:[0246]\\d{5,7}|(?:1[01-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])\\d{5,6})|5(?:0[0-6]|1[0-5]|2[0-68]|3[0-4]|4\\d|5[0-5]|6[03-5]|7[013]|8[0-79]|9[01])\\d{5,6}|6(?:[03]\\d{5,7}|(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])\\d{5,6})|8\\d{6,8}|9(?:0\\d{5,7}|(?:1[0-68]|2\\d|3[02-59]|4[0-4]|5[0-4]|6[01]|7[0135-8]|8[01])\\d{5,6})","\\d{5,9}"]
+,[,,"1(?:0[1-8]\\d{6}|[136]\\d{5,7}|(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)\\d{5,6})|2(?:[136]\\d{5,7}|(?:2[0-7]|4[0136-8]|5[0-38]|7[018]|8[01]|9[0-57])\\d{5,6})|3(?:[356]\\d{5,7}|(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])\\d{5,6})|4(?:[0246]\\d{5,7}|(?:1[0-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])\\d{5,6})|5(?:0[0-6]|1[0-5]|2[0-68]|3[0-4]|4\\d|5[0-5]|6[03-5]|7[013]|8[0-79]|9[01])\\d{5,6}|6(?:[03]\\d{5,7}|(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])\\d{5,6})|8\\d{6,8}|9(?:0\\d{5,7}|(?:1[0-68]|2\\d|3[02-59]|4[0-4]|5[0-4]|6[01]|7[0135-8]|8[01])\\d{5,6})","\\d{5,9}"]
 ,[,,"7[02-46]\\d{7}","\\d{9}"]
 ,[,,"20\\d{4,7}","\\d{6,9}"]
 ,[,,"9(?:00|39|44)\\d{7}","\\d{10}"]
@@ -4174,7 +4210,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"SL":[,[,,"[2-578]\\d{7}","\\d{6,8}"]
 ,[,,"[235]2[2-4][2-9]\\d{4}","\\d{6,8}"]
-,[,,"(?:25|3[03]|44|5[056]|7[6-8]|88)[1-9]\\d{5}","\\d{6,8}"]
+,[,,"(?:25|3[03]|44|5[056]|7[6-9]|88)\\d{6}","\\d{6,8}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -4218,7 +4254,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ]
 ,"SN":[,[,,"[37]\\d{8}","\\d{9}"]
 ,[,,"3(?:010|3(?:8[1-9]|9[2-9]))\\d{5}","\\d{9}"]
-,[,,"7(?:0[1256]0|6(?:1[23]|2[89]|3[3489]|4[6-9]|5[1-9]|6[3-9]|7[45]|8[3-8])|7(?:01|[12-79]\\d|8[0139]))\\d{5}","\\d{9}"]
+,[,,"7(?:0[1256]0|6(?:1[23]|2[89]|3[3489]|4[6-9]|5[1-9]|6[3-9]|7[45]|8[3-8])|7(?:01|[1-9]\\d))\\d{5}","\\d{9}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -4278,6 +4314,22 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"115","\\d{3}"]
 ,[,,"NA","NA"]
 ]
+,"SS":[,[,,"[1489]\\d{8}","\\d{9}"]
+,[,,"(?:1[67]\\d|811)\\d{6}","\\d{9}"]
+,[,,"(?:1(?:02|2[1269])|477|9(?:0[03689]|1\\d|2[024-9]|5[5-79]|77|98))\\d{6}","\\d{9}"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,[,,"NA","NA"]
+,"SS",211,"00","0",,,"0",,,,[[,"(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",,"0$1","",0]
+]
+,,[,,"NA","NA"]
+,,,[,,"NA","NA"]
+,[,,"NA","NA"]
+,,[,,"NA","NA"]
+,[,,"NA","NA"]
+]
 ,"ST":[,[,,"[29]\\d{6}","\\d{7}"]
 ,[,,"22\\d{5}","\\d{7}"]
 ,[,,"9[89]\\d{5}","\\d{7}"]
@@ -4717,7 +4769,7 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,[,,"NA","NA"]
 ]
 ,"UZ":[,[,,"[679]\\d{8}","\\d{7,9}"]
-,[,,"(?:6(?:1(?:22|3[124]|4[1-4]|5[123578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d{2}|7(?:[23]\\d|7[69]|)|9(?:4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[12456]|9[135-8])|1[12]\\d|2(?:22|3[1345789]|4[123579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-4579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}","\\d{7,9}"]
+,[,,"(?:6(?:1(?:22|3[124]|4[1-4]|5[123578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d{2}|7(?:[23]\\d|7[69]|)|9(?:4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[12456]|9[135-8])|1[12]\\d|2(?:22|3[1345789]|4[123579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}","\\d{7,9}"]
 ,[,,"6(?:1(?:2(?:98|2[01])|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:11\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4])|7\\d{2})|5(?:19[01]|2(?:27|9[26])|30\\d|59\\d|7\\d{2})|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|3[79]\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79])|9[0-3]\\d)|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(2(?:1[1267]|5\\d|3[01]|7[0-4])|5[67]\\d|6(?:2[0-26]|8\\d)|7\\d{2}))\\d{4}|7(?:0\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|33\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078])|9[4-6]\\d)|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0127]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[05629]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07])))\\d{4}|9[0-57-9]\\d{7}","\\d{7,9}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
@@ -4806,17 +4858,19 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,,[,,"911","\\d{3}"]
 ,[,,"NA","NA"]
 ]
-,"VN":[,[,,"8\\d{5,8}|[1-79]\\d{7,9}","\\d{7,10}"]
-,[,,"(?:2(?:[025-79]|1[0189]|[348][01])|3(?:[0136-9]|[25][01])|[48]\\d|5(?:[01][01]|[2-9])|6(?:[0-46-8]|5[01])|7(?:[02-79]|[18][01]))\\d{7}|69\\d{5,6}|80\\d{5}","\\d{7,10}"]
-,[,,"(?:9\\d|1(?:2\\d|6[3-9]|88|99))\\d{7}","\\d{9,10}"]
+,"VN":[,[,,"[17]\\d{6,9}|[2-69]\\d{7,9}|8\\d{6,8}","\\d{7,10}"]
+,[,,"(?:2(?:[025-79]|1[0189]|[348][01])|3(?:[0136-9]|[25][01])|4\\d|5(?:[01][01]|[2-9])|6(?:[0-46-8]|5[01])|7(?:[02-79]|[18][01])|8[1-9])\\d{7}","\\d{9,10}"]
+,[,,"(?:9\\d|1(?:2\\d|6[3-9]|8[68]|99))\\d{7}","\\d{9,10}"]
 ,[,,"1800\\d{4,6}","\\d{8,10}"]
 ,[,,"1900\\d{4,6}","\\d{8,10}"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
 ,[,,"NA","NA"]
-,"VN",84,"00","0",,,"0",,,,[[,"([48])(\\d{4})(\\d{4})","$1 $2 $3",["[48]"]
+,"VN",84,"00","0",,,"0",,,,[[,"([17]99)(\\d{4})","$1 $2",["[17]99"]
+,"0$1","",1]
+,[,"([48])(\\d{4})(\\d{4})","$1 $2 $3",["[48]"]
 ,"0$1","",1]
-,[,"([235-7]\\d)(\\d{4})(\\d{3})","$1 $2 $3",["2[025-79]|3[0136-9]|5[2-9]|6[0-46-9]|7[02-79]"]
+,[,"([235-7]\\d)(\\d{4})(\\d{3})","$1 $2 $3",["2[025-79]|3[0136-9]|5[2-9]|6[0-46-8]|7[02-79]"]
 ,"0$1","",1]
 ,[,"(80)(\\d{5})","$1 $2",["80"]
 ,"0$1","",1]
@@ -4826,14 +4880,14 @@ i18n.phonenumbers.metadata.countryToMetadata = {
 ,"0$1","",1]
 ,[,"(9\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"]
 ,"0$1","",1]
-,[,"(1[2689]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[26]|88|99)"]
+,[,"(1[2689]\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1(?:[26]|8[68]|99)"]
 ,"0$1","",1]
 ,[,"(1[89]00)(\\d{4,6})","$1 $2",["1[89]0"]
 ,"$1","",0]
 ]
 ,,[,,"NA","NA"]
-,,,[,,"NA","NA"]
-,[,,"NA","NA"]
+,,,[,,"[17]99\\d{4}|69\\d{5,6}","\\d{7,8}"]
+,[,,"[17]99\\d{4}|69\\d{5,6}|80\\d{5}","\\d{7,8}"]
 ,,[,,"11[345]","\\d{3}"]
 ,[,,"NA","NA"]
 ]
index 5b75193..e4a6fb6 100644 (file)
@@ -126,6 +126,17 @@ i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_COUNTRY_CODE_ = 3;
 
 
 /**
+ * We don't allow input strings for parsing to be longer than 250 chars. This
+ * prevents malicious input from consuming CPU.
+ *
+ * @const
+ * @type {number}
+ * @private
+ */
+i18n.phonenumbers.PhoneNumberUtil.MAX_INPUT_STRING_LENGTH_ = 250;
+
+
+/**
  * Region-code for the unknown region.
  *
  * @const
@@ -156,6 +167,14 @@ i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN = '+';
 
 
 /**
+ * @const
+ * @type {string}
+ * @private
+ */
+i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_ = '*';
+
+
+/**
  * The RFC 3966 format for extensions.
  *
  * @const
@@ -530,12 +549,11 @@ i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN_ =
 
 /**
  * @const
- * @type {!RegExp}
+ * @type {string}
  * @private
  */
 i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_ =
-    new RegExp('[' + i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION +
-               ']+', 'g');
+    '[' + i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION + ']+';
 
 
 /**
@@ -614,7 +632,8 @@ i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_PHONE_PATTERN_ =
  * used as a placeholder for carrier codes, for example in Brazilian phone
  * numbers. We also allow multiple '+' characters at the start.
  * Corresponds to the following:
- * plus_sign*([punctuation]*[digits]){3,}([punctuation]|[digits]|[alpha])*
+ * plus_sign*
+ * (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*
  * Note VALID_PUNCTUATION starts with a -, so must be the first in the range.
  *
  * @const
@@ -623,9 +642,11 @@ i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_PHONE_PATTERN_ =
  */
 i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_ =
     '[' + i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_ + ']*(?:[' +
-    i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION + ']*[' +
+    i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION +
+    i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_ + ']*[' +
     i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + ']){3,}[' +
     i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION +
+    i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_ +
     i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_ +
     i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + ']*';
 
@@ -1262,9 +1283,9 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.format =
   if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.E164) {
     // Early exit for E164 case since no formatting of the national number needs
     // to be applied. Extensions are not formatted.
-    return this.formatNumberByFormat_(countryCallingCode,
-                                      i18n.phonenumbers.PhoneNumberFormat.E164,
-                                      nationalSignificantNumber, '');
+    return this.prefixNumberWithCountryCallingCode_(
+        countryCallingCode, i18n.phonenumbers.PhoneNumberFormat.E164,
+        nationalSignificantNumber, '');
   }
   // Note getRegionCodeForCountryCode() is used because formatting information
   // for regions which share a country calling code is contained by only one
@@ -1284,13 +1305,11 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.format =
       this.maybeGetFormattedExtension_(number, metadata, numberFormat);
   /** @type {string} */
   var formattedNationalNumber =
-      this.formatNationalNumber_(nationalSignificantNumber,
-                                 metadata,
-                                 numberFormat);
-  return this.formatNumberByFormat_(countryCallingCode,
-                                    numberFormat,
-                                    formattedNationalNumber,
-                                    formattedExtension);
+      this.formatNsn_(nationalSignificantNumber, metadata, numberFormat);
+  return this.prefixNumberWithCountryCallingCode_(countryCallingCode,
+                                                  numberFormat,
+                                                  formattedNationalNumber,
+                                                  formattedExtension);
 };
 
 
@@ -1326,27 +1345,30 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatByPattern =
   if (!this.hasValidCountryCallingCode_(countryCallingCode)) {
     return nationalSignificantNumber;
   }
-  /** @type {Array.<i18n.phonenumbers.NumberFormat>} */
-  var userDefinedFormatsCopy = [];
   /** @type {i18n.phonenumbers.PhoneMetadata} */
   var metadata =
       this.getMetadataForRegionOrCallingCode_(countryCallingCode, regionCode);
-  /** @type {number} */
-  var size = userDefinedFormats.length;
-  for (var i = 0; i < size; ++i) {
-    /** @type {i18n.phonenumbers.NumberFormat} */
-    var numFormat = userDefinedFormats[i];
+
+  /** @type {string} */
+  var formattedNumber = '';
+
+  /** @type {i18n.phonenumbers.NumberFormat} */
+  var formattingPattern = this.chooseFormattingPatternForNumber_(
+      userDefinedFormats, nationalSignificantNumber);
+  if (formattingPattern == null) {
+    // If no pattern above is matched, we format the number as a whole.
+    formattedNumber = nationalSignificantNumber;
+  } else {
+    // Before we do a replacement of the national prefix pattern $NP with the
+    // national prefix, we need to copy the rule so that subsequent replacements
+    // for different numbers have the appropriate national prefix.
+    /** type {i18n.phonenumbers.NumberFormat} */
+    var numFormatCopy = formattingPattern.clone();
     /** @type {string} */
     var nationalPrefixFormattingRule =
-        numFormat.getNationalPrefixFormattingRuleOrDefault();
+        formattingPattern.getNationalPrefixFormattingRuleOrDefault();
+    /** @type {string} */
     if (nationalPrefixFormattingRule.length > 0) {
-      // Before we do a replacement of the national prefix pattern $NP with the
-      // national prefix, we need to copy the rule so that subsequent
-      // replacements for different numbers have the appropriate national
-      // prefix.
-      /** type {i18n.phonenumbers.NumberFormat} */
-      var numFormatCopy = numFormat.clone();
-      /** @type {string} */
       var nationalPrefix = metadata.getNationalPrefixOrDefault();
       if (nationalPrefix.length > 0) {
         // Replace $NP with national prefix and $FG with the first group ($1).
@@ -1361,26 +1383,18 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatByPattern =
         // there isn't one.
         numFormatCopy.clearNationalPrefixFormattingRule();
       }
-      userDefinedFormatsCopy.push(numFormatCopy);
-    } else {
-      // Otherwise, we just add the original rule to the modified list of
-      // formats.
-      userDefinedFormatsCopy.push(numFormat);
     }
+    formattedNumber = this.formatNsnUsingPattern_(
+        nationalSignificantNumber, numFormatCopy, numberFormat);
   }
 
   /** @type {string} */
   var formattedExtension =
       this.maybeGetFormattedExtension_(number, metadata, numberFormat);
-  /** @type {string} */
-  var formattedNationalNumber =
-      this.formatAccordingToFormats_(nationalSignificantNumber,
-                                     userDefinedFormatsCopy,
-                                     numberFormat);
-  return this.formatNumberByFormat_(countryCallingCode,
-                                    numberFormat,
-                                    formattedNationalNumber,
-                                    formattedExtension);
+  return this.prefixNumberWithCountryCallingCode_(countryCallingCode,
+                                                  numberFormat,
+                                                  formattedNumber,
+                                                  formattedExtension);
 };
 
 
@@ -1421,12 +1435,10 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.
   var formattedExtension = this.maybeGetFormattedExtension_(
       number, metadata, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
   /** @type {string} */
-  var formattedNationalNumber =
-      this.formatNationalNumber_(nationalSignificantNumber,
-                                 metadata,
-                                 i18n.phonenumbers.PhoneNumberFormat.NATIONAL,
-                                 carrierCode);
-  return this.formatNumberByFormat_(
+  var formattedNationalNumber = this.formatNsn_(
+      nationalSignificantNumber, metadata,
+      i18n.phonenumbers.PhoneNumberFormat.NATIONAL, carrierCode);
+  return this.prefixNumberWithCountryCallingCode_(
       countryCallingCode, i18n.phonenumbers.PhoneNumberFormat.NATIONAL,
       formattedNationalNumber, formattedExtension);
 };
@@ -1599,7 +1611,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatOutOfCountryCallingNumber =
           this.format(number, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
     }
   } else if (countryCallingCode ==
-                 this.getCountryCodeForRegion(regionCallingFrom)) {
+                 this.getCountryCodeForValidRegion_(regionCallingFrom)) {
     // For regions that share a country calling code, the country calling code
     // need not be dialled. This also applies when dialling within a region, so
     // this if clause covers both these cases. Technically this is the case for
@@ -1638,16 +1650,16 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatOutOfCountryCallingNumber =
   var metadataForRegion =
       this.getMetadataForRegionOrCallingCode_(countryCallingCode, regionCode);
   /** @type {string} */
-  var formattedNationalNumber =
-      this.formatNationalNumber_(nationalSignificantNumber, metadataForRegion,
-          i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
+  var formattedNationalNumber = this.formatNsn_(
+      nationalSignificantNumber, metadataForRegion,
+      i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
   /** @type {string} */
   var formattedExtension = this.maybeGetFormattedExtension_(number,
       metadataForRegion, i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
   return internationalPrefixForFormatting.length > 0 ?
       internationalPrefixForFormatting + ' ' + countryCallingCode + ' ' +
           formattedNationalNumber + formattedExtension :
-      this.formatNumberByFormat_(
+      this.prefixNumberWithCountryCallingCode_(
           countryCallingCode, i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL,
           formattedNationalNumber, formattedExtension);
 };
@@ -1664,6 +1676,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatOutOfCountryCallingNumber =
  *
  * Note this method guarantees no digit will be inserted, removed or modified as
  * a result of formatting.
+ *
  * @param {i18n.phonenumbers.PhoneNumber} number the phone number that needs to
  *     be formatted in its original number format.
  * @param {string} regionCallingFrom the region whose IDD needs to be prefixed
@@ -1926,31 +1939,30 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.
     if (this.isNANPACountry(regionCallingFrom)) {
       return countryCode + ' ' + rawInput;
     }
-  } else if (countryCode == this.getCountryCodeForRegion(regionCallingFrom)) {
-    // Here we copy the formatting rules so we can modify the pattern we expect
-    // to match against.
-    /** @type {Array.<i18n.phonenumbers.NumberFormat>} */
-    var availableFormats = [];
-    for (var i = 0; i < metadataForRegionCallingFrom.numberFormatArray().length;
-         ++i) {
-      /** @type {i18n.phonenumbers.NumberFormat} */
-      var newFormat =
-          metadataForRegionCallingFrom.numberFormatArray()[i].clone();
-      // The first group is the first group of digits that the user determined.
-      newFormat.setPattern('(\\d+)(.*)');
-      // Here we just concatenate them back together after the national prefix
-      // has been fixed.
-      newFormat.setFormat('$1$2');
-      availableFormats.push(newFormat);
+  } else if (this.isValidRegionCode_(regionCallingFrom) &&
+      countryCode == this.getCountryCodeForValidRegion_(regionCallingFrom)) {
+    /** @type {i18n.phonenumbers.NumberFormat} */
+    var formattingPattern = this.chooseFormattingPatternForNumber_(
+        metadataForRegionCallingFrom.numberFormatArray(), nationalNumber);
+    if (formattingPattern == null) {
+      // If no pattern above is matched, we format the original input.
+      return rawInput;
     }
-    // Now we format using these patterns instead of the default pattern, but
-    // with the national prefix prefixed if necessary, by choosing the format
-    // rule based on the leading digits present in the unformatted national
-    // number. This will not work in the cases where the pattern (and not the
-    // leading digits) decide whether a national prefix needs to be used, since
-    // we have overridden the pattern to match anything, but that is not the
-    // case in the metadata to date.
-    return this.formatAccordingToFormats_(rawInput, availableFormats,
+    /** @type {i18n.phonenumbers.NumberFormat} */
+    var newFormat = formattingPattern.clone();
+    // The first group is the first group of digits that the user wrote
+    // together.
+    newFormat.setPattern('(\\d+)(.*)');
+    // Here we just concatenate them back together after the national prefix
+    // has been fixed.
+    newFormat.setFormat('$1$2');
+    // Now we format using this pattern instead of the default pattern, but
+    // with the national prefix prefixed if necessary.
+    // This will not work in the cases where the pattern (and not the leading
+    // digits) decide whether a national prefix needs to be used, since we have
+    // overridden the pattern to match anything, but that is not the case in the
+    // metadata to date.
+    return this.formatNsnUsingPattern_(rawInput, newFormat,
         i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
   }
   /** @type {string} */
@@ -1985,7 +1997,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.
     // Invalid region entered as country-calling-from (so no metadata was found
     // for it) or the region chosen has multiple international dialling
     // prefixes.
-    return this.formatNumberByFormat_(
+    return this.prefixNumberWithCountryCallingCode_(
         countryCode, i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL,
         rawInput, formattedExtension);
   }
@@ -2026,9 +2038,11 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.getNationalSignificantNumber =
  * @return {string} the formatted phone number.
  * @private
  */
-i18n.phonenumbers.PhoneNumberUtil.prototype.formatNumberByFormat_ =
-    function(countryCallingCode, numberFormat,
-             formattedNationalNumber, formattedExtension) {
+i18n.phonenumbers.PhoneNumberUtil.prototype.
+    prefixNumberWithCountryCallingCode_ = function(countryCallingCode,
+                                                   numberFormat,
+                                                   formattedNationalNumber,
+                                                   formattedExtension) {
 
   switch (numberFormat) {
     case i18n.phonenumbers.PhoneNumberFormat.E164:
@@ -2063,7 +2077,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatNumberByFormat_ =
  * @return {string} the formatted phone number.
  * @private
  */
-i18n.phonenumbers.PhoneNumberUtil.prototype.formatNationalNumber_ =
+i18n.phonenumbers.PhoneNumberUtil.prototype.formatNsn_ =
     function(number, metadata, numberFormat, opt_carrierCode) {
 
   /** @type {Array.<i18n.phonenumbers.NumberFormat>} */
@@ -2075,14 +2089,13 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatNationalNumber_ =
       (intlNumberFormats.length == 0 ||
           numberFormat == i18n.phonenumbers.PhoneNumberFormat.NATIONAL) ?
       metadata.numberFormatArray() : metadata.intlNumberFormatArray();
-  /** @type {string} */
-  var formattedNationalNumber = this.formatAccordingToFormats_(
-      number, availableFormats, numberFormat, opt_carrierCode);
-  if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.RFC3966) {
-    formattedNationalNumber = formattedNationalNumber.replace(
-        i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_, '-');
-  }
-  return formattedNationalNumber;
+  /** @type {i18n.phonenumbers.NumberFormat} */
+  var formattingPattern = this.chooseFormattingPatternForNumber_(
+      availableFormats, number);
+  return (formattingPattern == null) ?
+      number :
+      this.formatNsnUsingPattern_(number, formattingPattern,
+                                  numberFormat, opt_carrierCode);
 };
 
 
@@ -2128,31 +2141,26 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.chooseFormattingPatternForNumber_ =
  *
  * @param {string} nationalNumber a string of characters representing a phone
  *     number.
- * @param {Array.<i18n.phonenumbers.NumberFormat>} availableFormats the
- *     available formats the phone number could be formatted into.
+ * @param {i18n.phonenumbers.NumberFormat} formattingPattern the formatting rule
+ *     the phone number should be formatted into.
  * @param {i18n.phonenumbers.PhoneNumberFormat} numberFormat the format the
  *     phone number should be formatted into.
  * @param {string=} opt_carrierCode
  * @return {string} the formatted phone number.
  * @private
  */
-i18n.phonenumbers.PhoneNumberUtil.prototype.formatAccordingToFormats_ =
-    function(nationalNumber, availableFormats, numberFormat, opt_carrierCode) {
+i18n.phonenumbers.PhoneNumberUtil.prototype.formatNsnUsingPattern_ =
+    function(nationalNumber, formattingPattern, numberFormat, opt_carrierCode) {
 
-  /** @type {i18n.phonenumbers.NumberFormat} */
-  var numFormat = this.chooseFormattingPatternForNumber_(availableFormats,
-                                                         nationalNumber);
-  if (numFormat == null) {
-    // If no pattern above is matched, we format the number as a whole.
-    return nationalNumber;
-  }
   /** @type {string} */
-  var numberFormatRule = numFormat.getFormatOrDefault();
+  var numberFormatRule = formattingPattern.getFormatOrDefault();
   /** @type {!RegExp} */
-  var patternToMatch = new RegExp(numFormat.getPattern());
+  var patternToMatch = new RegExp(formattingPattern.getPattern());
   /** @type {string} */
   var domesticCarrierCodeFormattingRule =
-      numFormat.getDomesticCarrierCodeFormattingRuleOrDefault();
+      formattingPattern.getDomesticCarrierCodeFormattingRuleOrDefault();
+  /** @type {string} */
+  var formattedNationalNumber = '';
   if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.NATIONAL &&
       opt_carrierCode != null && opt_carrierCode.length > 0 &&
       domesticCarrierCodeFormattingRule.length > 0) {
@@ -2166,22 +2174,36 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.formatAccordingToFormats_ =
     numberFormatRule = numberFormatRule.replace(
         i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_,
         carrierCodeFormattingRule);
-    return nationalNumber.replace(patternToMatch, numberFormatRule);
+    formattedNationalNumber =
+        nationalNumber.replace(patternToMatch, numberFormatRule);
   } else {
     // Use the national prefix formatting rule instead.
     /** @type {string} */
     var nationalPrefixFormattingRule =
-        numFormat.getNationalPrefixFormattingRuleOrDefault();
+        formattingPattern.getNationalPrefixFormattingRuleOrDefault();
     if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.NATIONAL &&
         nationalPrefixFormattingRule != null &&
         nationalPrefixFormattingRule.length > 0) {
-      return nationalNumber.replace(patternToMatch, numberFormatRule
-          .replace(i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_,
-                   nationalPrefixFormattingRule));
+      formattedNationalNumber = nationalNumber.replace(patternToMatch,
+          numberFormatRule.replace(
+              i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_,
+              nationalPrefixFormattingRule));
     } else {
-      return nationalNumber.replace(patternToMatch, numberFormatRule);
+      formattedNationalNumber =
+          nationalNumber.replace(patternToMatch, numberFormatRule);
     }
   }
+  if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.RFC3966) {
+    // Strip any leading punctuation.
+    formattedNationalNumber = formattedNationalNumber.replace(
+        new RegExp('^' + i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_),
+        '');
+    // Replace the rest with a dash between each number group.
+    formattedNationalNumber = formattedNationalNumber.replace(
+        new RegExp(i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_, 'g'),
+        '-');
+  }
+  return formattedNationalNumber;
 };
 
 
@@ -2288,31 +2310,15 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.maybeGetFormattedExtension_ =
     if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.RFC3966) {
       return i18n.phonenumbers.PhoneNumberUtil.RFC3966_EXTN_PREFIX_ +
           number.getExtension();
+    } else {
+      if (metadata.hasPreferredExtnPrefix()) {
+        return metadata.getPreferredExtnPrefix() +
+            number.getExtensionOrDefault();
+      } else {
+        return i18n.phonenumbers.PhoneNumberUtil.DEFAULT_EXTN_PREFIX_ +
+            number.getExtensionOrDefault();
+      }
     }
-    return this.formatExtension_(number.getExtensionOrDefault(), metadata);
-  }
-};
-
-
-/**
- * Formats the extension part of the phone number by prefixing it with the
- * appropriate extension prefix. This will be the default extension prefix,
- * unless overridden by a preferred extension prefix for this region.
- *
- * @param {string} extensionDigits the extension digits.
- * @param {i18n.phonenumbers.PhoneMetadata} metadata the metadata for the
- *     region that we think this number is from.
- * @return {string} the formatted extension.
- * @private
- */
-i18n.phonenumbers.PhoneNumberUtil.prototype.formatExtension_ =
-    function(extensionDigits, metadata) {
-
-  if (metadata.hasPreferredExtnPrefix()) {
-    return metadata.getPreferredExtnPrefix() + extensionDigits;
-  } else {
-    return i18n.phonenumbers.PhoneNumberUtil.DEFAULT_EXTN_PREFIX_ +
-        extensionDigits;
   }
 };
 
@@ -2541,15 +2547,17 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.isValidNumberForRegion =
 
   /** @type {number} */
   var countryCode = number.getCountryCodeOrDefault();
-  if (countryCode == 0 ||
+  /** @type {i18n.phonenumbers.PhoneMetadata} */
+  var metadata =
+      this.getMetadataForRegionOrCallingCode_(countryCode, regionCode);
+  if (metadata == null ||
       (i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY !=
        regionCode &&
-       countryCode != this.getCountryCodeForRegion(regionCode))) {
+       countryCode != this.getCountryCodeForValidRegion_(regionCode))) {
+    // Either the region code was invalid, or the country calling code for this
+    // number does not match that of the region code.
     return false;
   }
-  /** @type {i18n.phonenumbers.PhoneMetadata} */
-  var metadata =
-      this.getMetadataForRegionOrCallingCode_(countryCode, regionCode);
   /** @type {i18n.phonenumbers.PhoneNumberDesc} */
   var generalNumDesc = metadata.getGeneralDesc();
   /** @type {string} */
@@ -2670,6 +2678,24 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.getCountryCodeForRegion =
   if (!this.isValidRegionCode_(regionCode)) {
     return 0;
   }
+  return this.getCountryCodeForValidRegion_(regionCode);
+};
+
+
+/**
+ * Returns the country calling code for a specific region. For example, this
+ * would be 1 for the United States, and 64 for New Zealand. Assumes the region
+ * is already valid.
+ *
+ * @param {?string} regionCode the region that we want to get the country
+ *     calling code for.
+ * @return {number} the country calling code for the region denoted by
+ *     regionCode.
+ * @private
+ */
+i18n.phonenumbers.PhoneNumberUtil.prototype.getCountryCodeForValidRegion_ =
+    function(regionCode) {
+
   /** @type {i18n.phonenumbers.PhoneMetadata} */
   var metadata = this.getMetadataForRegion(regionCode);
   return metadata.getCountryCodeOrDefault();
@@ -3435,6 +3461,9 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.parseHelper_ =
 
   if (numberToParse == null) {
     throw i18n.phonenumbers.Error.NOT_A_NUMBER;
+  } else if (numberToParse.length >
+      i18n.phonenumbers.PhoneNumberUtil.MAX_INPUT_STRING_LENGTH_) {
+    throw 'The string supplied was too long to parse';
   }
   // Extract a possible number from the string passed in (this strips leading
   // characters that could not be the start of a phone number.)
index 113264e..5abd8de 100644 (file)
@@ -970,6 +970,10 @@ function testFormatByPattern() {
                phoneUtil.formatByPattern(US_NUMBER,
                                          PNF.INTERNATIONAL,
                                          [newNumFormat]));
+  assertEquals('+1-650-253-0000',
+               phoneUtil.formatByPattern(US_NUMBER,
+                                         PNF.RFC3966,
+                                         [newNumFormat]));
 
   // $NP is set to '1' for the US. Here we check that for other NANPA countries
   // the US rules are followed.
@@ -1383,6 +1387,21 @@ function testIsValidForRegion() {
                                               RegionCode.UN001));
   assertFalse(phoneUtil.isValidNumberForRegion(INTERNATIONAL_TOLL_FREE,
                                                RegionCode.US));
+  assertFalse(phoneUtil.isValidNumberForRegion(INTERNATIONAL_TOLL_FREE,
+                                               RegionCode.ZZ));
+
+  /** @type {i18n.phonenumbers.PhoneNumber} */
+  var invalidNumber = new i18n.phonenumbers.PhoneNumber();
+  // Invalid country calling codes.
+  invalidNumber.setCountryCode(3923);
+  invalidNumber.setNationalNumber(2366);
+  assertFalse(phoneUtil.isValidNumberForRegion(invalidNumber, RegionCode.ZZ));
+  assertFalse(phoneUtil.isValidNumberForRegion(invalidNumber,
+                                               RegionCode.UN001));
+  invalidNumber.setCountryCode(0);
+  assertFalse(phoneUtil.isValidNumberForRegion(invalidNumber,
+                                               RegionCode.UN001));
+  assertFalse(phoneUtil.isValidNumberForRegion(invalidNumber, RegionCode.ZZ));
 }
 
 function testIsNotValidNumber() {
@@ -1410,6 +1429,14 @@ function testIsNotValidNumber() {
   invalidNumber.setNationalNumber(3316005);
   assertFalse(phoneUtil.isValidNumber(invalidNumber));
 
+  invalidNumber = new i18n.phonenumbers.PhoneNumber();
+  // Invalid country calling codes.
+  invalidNumber.setCountryCode(3923);
+  invalidNumber.setNationalNumber(2366);
+  assertFalse(phoneUtil.isValidNumber(invalidNumber));
+  invalidNumber.setCountryCode(0);
+  assertFalse(phoneUtil.isValidNumber(invalidNumber));
+
   assertFalse(phoneUtil.isValidNumber(INTERNATIONAL_TOLL_FREE_TOO_LONG));
 }
 
@@ -2015,6 +2042,11 @@ function testParseNationalNumber() {
   usNumber.setCountryCode(1);
   usNumber.setNationalNumber(1234567890);
   assertTrue(usNumber.equals(phoneUtil.parse('123-456-7890', RegionCode.US)));
+
+  // Test star numbers. Although this is not strictly valid, we would like to
+  // make sure we can parse the output we produce when formatting the number.
+  assertTrue(
+      JP_STAR_NUMBER.equals(phoneUtil.parse("+81 *2345", RegionCode.JP)));
 }
 
 function testParseNumberWithAlphaCharacters() {
@@ -2043,6 +2075,42 @@ function testParseNumberWithAlphaCharacters() {
       phoneUtil.parse('0900 a332 600A5', RegionCode.NZ)));
 }
 
+function testParseMaliciousInput() {
+  // Lots of leading + signs before the possible number.
+  /** @type {!goog.string.StringBuffer} */
+  var maliciousNumber = new goog.string.StringBuffer();
+  for (var i = 0; i < 6000; i++) {
+    maliciousNumber.append('+');
+  }
+  maliciousNumber.append('12222-33-244 extensioB 343+');
+  try {
+    phoneUtil.parse(maliciousNumber.toString(), RegionCode.US);
+    fail('This should not parse without throwing an exception ' +
+         maliciousNumber.toString());
+  } catch (e) {
+    // Expected this exception.
+    assertEquals('Wrong error type stored in exception.',
+                 'The string supplied was too long to parse',
+                 e);
+  }
+  /** @type {!goog.string.StringBuffer} */
+  var maliciousNumberWithAlmostExt = new goog.string.StringBuffer();
+  for (i = 0; i < 350; i++) {
+    maliciousNumberWithAlmostExt.append('200');
+  }
+  maliciousNumberWithAlmostExt.append(' extensiOB 345');
+  try {
+    phoneUtil.parse(maliciousNumberWithAlmostExt.toString(), RegionCode.US);
+    fail('This should not parse without throwing an exception ' +
+         maliciousNumberWithAlmostExt.toString());
+  } catch (e) {
+    // Expected this exception.
+    assertEquals('Wrong error type stored in exception.',
+                 'The string supplied was too long to parse',
+                 e);
+  }
+}
+
 function testParseWithInternationalPrefixes() {
   assertTrue(US_NUMBER.equals(
       phoneUtil.parse('+1 (650) 253-0000', RegionCode.NZ)));
@@ -2234,6 +2302,29 @@ function testFailedParseOnInvalidNumbers() {
   }
   try {
     /** @type {string} */
+    var plusStar = '+***';
+    phoneUtil.parse(plusStar, RegionCode.DE);
+    fail('This should not parse without throwing an exception ' + plusStar);
+  } catch (e) {
+    // Expected this exception.
+    assertEquals('Wrong error type stored in exception.',
+                 i18n.phonenumbers.Error.NOT_A_NUMBER,
+                 e);
+  }
+  try {
+    /** @type {string} */
+    var plusStarPhoneNumber = '+*******91';
+    phoneUtil.parse(plusStarPhoneNumber, RegionCode.DE);
+    fail('This should not parse without throwing an exception ' +
+         plusStarPhoneNumber);
+  } catch (e) {
+    // Expected this exception.
+    assertEquals('Wrong error type stored in exception.',
+                 i18n.phonenumbers.Error.NOT_A_NUMBER,
+                 e);
+  }
+  try {
+    /** @type {string} */
     var tooShortPhoneNumber = '+49 0';
     phoneUtil.parse(tooShortPhoneNumber, RegionCode.DE);
     fail('This should not parse without throwing an exception ' +