diff --git a/java/release_notes.txt b/java/release_notes.txt index 59f43ef3e..1963e5619 100644 --- a/java/release_notes.txt +++ b/java/release_notes.txt @@ -1,3 +1,13 @@ +May 24th, 2011 +* Code changes: + - Phonenumber now implements Serializable. + - findNumbers doesn't accept numbers with mis-matched brackets as phone-numbers + - An offline phone number geocoder has been added. The current implementation just returns the + region name for the phone number; more detailed geocoding will be added later. +* Metadata changes: + - New countries: GF, KP, NC, PA, PF, PW, PY, SB, SR, TO, UY, VU + - Updates: CY, CZ, ES, GB, GQ, JM, MQ, TN, VI + May 9th, 2011 * Code changes: - Fixed potential for a null-ptr exception in getExampleNumber diff --git a/java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java b/java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java index 09eb35c4b..68ad3adab 100644 --- a/java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java +++ b/java/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java @@ -69,6 +69,13 @@ final class PhoneNumberMatcher implements Iterator { private static final Pattern SLASH_SEPARATED_DATES = Pattern.compile("(?:(?:[0-3]?\\d/[01]?\\d)|(?:[01]?\\d/[0-3]?\\d))/(?:[12]\\d)?\\d{2}"); + /** + * Pattern to check that brackets match. Opening brackets should be closed within a phone number. + * This also checks that there is something inside the brackets. Having no brackets at all is also + * fine. + */ + private static final Pattern MATCHING_BRACKETS; + /** * Matches white-space, which may indicate the end of a phone number and the start of something * else (such as a neighbouring zip-code). @@ -76,8 +83,25 @@ final class PhoneNumberMatcher implements Iterator { private static final Pattern GROUP_SEPARATOR = Pattern.compile("\\p{Z}+"); static { - /* Builds the PATTERN regular expression. The building blocks below exist to make the pattern - * more easily understood. */ + /* Builds the MATCHING_BRACKETS and PATTERN regular expressions. The building blocks below exist + * to make the pattern more easily understood. */ + + String openingParens = "(\\[\uFF08\uFF3B"; + String closingParens = ")\\]\uFF09\uFF3D"; + String nonParens = "[^" + openingParens + closingParens + "]"; + + /* Limit on the number of pairs of brackets in a phone number. */ + String bracketPairLimit = limit(0, 3); + /* + * An opening bracket at the beginning may not be closed, but subsequent ones should be. It's + * also possible that the leading bracket was dropped, so we shouldn't be surprised if we see a + * closing bracket first. We limit the sets of brackets in a phone number to four. + */ + MATCHING_BRACKETS = Pattern.compile( + "(?:[" + openingParens + "])?" + "(?:" + nonParens + "+" + "[" + closingParens + "])?" + + nonParens + "+" + + "(?:[" + openingParens + "]" + nonParens + "+[" + closingParens + "])" + bracketPairLimit + + nonParens + "*"); /* Limit on the number of leading (plus) characters. */ String leadLimit = limit(0, 2); @@ -97,7 +121,7 @@ final class PhoneNumberMatcher implements Iterator { /* A digits block without punctuation. */ String digitSequence = "\\p{Nd}" + limit(1, digitBlockLimit); /* Punctuation that may be at the start of a phone number - brackets and plus signs. */ - String leadClass = "[(\\[" + PhoneNumberUtil.PLUS_CHARS + "]"; + String leadClass = "[" + openingParens + PhoneNumberUtil.PLUS_CHARS + "]"; /* Phone number pattern allowing optional punctuation. */ PATTERN = Pattern.compile( @@ -321,6 +345,11 @@ final class PhoneNumberMatcher implements Iterator { */ private PhoneNumberMatch parseAndVerify(String candidate, int offset) { try { + // Check the candidate doesn't contain any formatting which would indicate that it really + // isn't a phone number. + if (!MATCHING_BRACKETS.matcher(candidate).matches()) { + return null; + } PhoneNumber number = util.parse(candidate, preferredRegion); if (leniency.verify(number, util)) { return new PhoneNumberMatch(offset, candidate, number); diff --git a/java/src/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoder.java b/java/src/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoder.java new file mode 100644 index 000000000..fcd1be20c --- /dev/null +++ b/java/src/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoder.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.i18n.phonenumbers; + +import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber; + +import java.util.Locale; + +/** + * A offline geocoder which provides geographical information related to a phone number. + * + * @author Shaopeng Jia + */ +public class PhoneNumberOfflineGeocoder { + private static PhoneNumberOfflineGeocoder instance = null; + private PhoneNumberUtil phoneUtil; + + /** + * For testing purposes, we allow the phone number util variable to be injected. + */ + PhoneNumberOfflineGeocoder(PhoneNumberUtil phoneUtil) { + this.phoneUtil = phoneUtil; + } + + /** + * Gets a {@link PhoneNumberOfflineGeocoder} instance to carry out international phone number + * geocoding. + * + *

The {@link PhoneNumberOfflineGeocoder} is implemented as a singleton. Therefore, calling + * this method multiple times will only result in one instance being created. + * + * @return a {@link PhoneNumberOfflineGeocoder} instance + */ + public static synchronized PhoneNumberOfflineGeocoder getInstance() { + if (instance == null) { + instance = new PhoneNumberOfflineGeocoder(PhoneNumberUtil.getInstance()); + } + return instance; + } + + /** + * Returns the customary display name in the given language for the given territory the phone + * number is from. + */ + private String getCountryNameForNumber(PhoneNumber number, Locale language) { + String regionCode = phoneUtil.getRegionCodeForNumber(number); + return (regionCode == null || regionCode.equals("ZZ")) + ? "" : new Locale("", regionCode).getDisplayCountry(language); + } + + /** + * Returns a text description in the given language for the given phone number. The + * description might consist of the name of the country where the phone number is from and/or the + * name of the geographical area the phone number is from. + * + * @param number the phone number for which we want to get a text description + * @param language the language in which the description should be written + * @return a text description in the given language for the given phone number + */ + public String getDescriptionForNumber(PhoneNumber number, Locale language) { + // TODO: Implement logic to figure out fine-grained geographical information based + // on area code here. + return getCountryNameForNumber(number, language); + } +} diff --git a/java/src/com/google/i18n/phonenumbers/Phonenumber.java b/java/src/com/google/i18n/phonenumbers/Phonenumber.java index 788703ce7..3f7d23e25 100644 --- a/java/src/com/google/i18n/phonenumbers/Phonenumber.java +++ b/java/src/com/google/i18n/phonenumbers/Phonenumber.java @@ -22,9 +22,12 @@ package com.google.i18n.phonenumbers; +import java.io.Serializable; + public final class Phonenumber { private Phonenumber() {} - public static class PhoneNumber { + public static class PhoneNumber implements Serializable { + private static final long serialVersionUID = 1L; public enum CountryCodeSource { FROM_NUMBER_WITH_PLUS_SIGN, FROM_NUMBER_WITH_IDD, diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CY index 03e18fb48..fb374ed8a 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CY and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CY differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ index 0d263a1b2..43ec39e76 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CZ differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES index 17bf18571..2ae03c96b 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ES differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB index 843c00c40..d1ae75813 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GB differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF index fd17d8d46..b84bf2031 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GF differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GQ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GQ index a94a26e2a..2444a7479 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GQ and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_GQ differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JM b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JM index 23edbe712..dce03a832 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JM and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JM differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KP b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KP index dbc742e48..aa771a1a7 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KP and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KP differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ index bf62c3e80..889f64941 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MQ differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NC b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NC index c8091d15f..cfa92c516 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NC and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_NC differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA index ed8860819..ad660fc21 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PA differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PF b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PF index bbdd91bf8..cd67c8b64 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PF and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PF differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PW b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PW index 1b99676f0..f51d0d167 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PW and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PW differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PY index ab59e4176..628bd8733 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PY and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PY differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SB b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SB index a640f6882..552474069 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SB and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SB differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SR b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SR index c1dc5a1e7..a2150452b 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SR and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SR differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TN b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TN index 7a24c419a..b4c07475c 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TN and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TN differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TO b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TO index 10728f313..256eebfae 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TO and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_TO differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UY b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UY index b717cb187..ebf41e108 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UY and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_UY differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VI b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VI index e658ba13c..3f93a8978 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VI and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VI differ diff --git a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VU b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VU index 2c79ade13..40c22cd2c 100644 Binary files a/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VU and b/java/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_VU differ diff --git a/java/test/com/google/i18n/phonenumbers/PhoneNumberMatcherTest.java b/java/test/com/google/i18n/phonenumbers/PhoneNumberMatcherTest.java index 704e5d4f0..0c55964b5 100644 --- a/java/test/com/google/i18n/phonenumbers/PhoneNumberMatcherTest.java +++ b/java/test/com/google/i18n/phonenumbers/PhoneNumberMatcherTest.java @@ -221,6 +221,25 @@ public class PhoneNumberMatcherTest extends TestCase { assertEquals(number, matchWithSpaces.rawString()); } + public void testNonMatchingBracketsAreInvalid() throws Exception { + // The digits up to the ", " form a valid US number, but it shouldn't be matched as one since + // there was a non-matching bracket present. + assertTrue(hasNoMatches(phoneUtil.findNumbers( + "80.585 [79.964, 81.191]", "US"))); + + // The trailing "]" is thrown away before parsing, so the resultant number, while a valid US + // number, does not have matching brackets. + assertTrue(hasNoMatches(phoneUtil.findNumbers( + "80.585 [79.964]", "US"))); + + assertTrue(hasNoMatches(phoneUtil.findNumbers( + "80.585 ((79.964)", "US"))); + + // This case has too many sets of brackets to be valid. + assertTrue(hasNoMatches(phoneUtil.findNumbers( + "(80).(585) (79).(9)64", "US"))); + } + public void testNoMatchIfRegionIsNull() throws Exception { // Fail on non-international prefix if region code is null. assertTrue(hasNoMatches(phoneUtil.findNumbers( diff --git a/java/test/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoderTest.java b/java/test/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoderTest.java new file mode 100644 index 000000000..facd3c4ac --- /dev/null +++ b/java/test/com/google/i18n/phonenumbers/PhoneNumberOfflineGeocoderTest.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.i18n.phonenumbers; + +import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber; +import junit.framework.TestCase; + +import java.util.Locale; + +/** + * Unit tests for PhoneNumberOfflineGeocoder.java + * + * @author Shaopeng Jia + */ +public class PhoneNumberOfflineGeocoderTest extends TestCase { + private PhoneNumberOfflineGeocoder geocoder; + static final String TEST_META_DATA_FILE_PREFIX = + "/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting"; + + // Set up some test numbers to re-use. + private static final PhoneNumber US_NUMBER1 = + new PhoneNumber().setCountryCode(1).setNationalNumber(6502530000L); + private static final PhoneNumber BS_NUMBER1 = + new PhoneNumber().setCountryCode(1).setNationalNumber(2423651234L); + private static final PhoneNumber AU_NUMBER = + new PhoneNumber().setCountryCode(61).setNationalNumber(236618300L); + private static final PhoneNumber NUMBER_WITH_INVALID_COUNTRY_CODE = + new PhoneNumber().setCountryCode(999).setNationalNumber(2423651234L); + + public PhoneNumberOfflineGeocoderTest() { + PhoneNumberUtil.resetInstance(); + PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance( + TEST_META_DATA_FILE_PREFIX, + CountryCodeToRegionCodeMapForTesting.getCountryCodeToRegionCodeMap()); + geocoder = new PhoneNumberOfflineGeocoder(phoneUtil); + } + + public void testGetCompactDescriptionForNumber() { + assertEquals("United States", + geocoder.getDescriptionForNumber(US_NUMBER1, Locale.ENGLISH)); + assertEquals("Stati Uniti", + geocoder.getDescriptionForNumber(US_NUMBER1, Locale.ITALIAN)); + assertEquals("Bahamas", + geocoder.getDescriptionForNumber(BS_NUMBER1, Locale.ENGLISH)); + assertEquals("Australia", + geocoder.getDescriptionForNumber(AU_NUMBER, Locale.ENGLISH)); + assertEquals("", geocoder.getDescriptionForNumber(NUMBER_WITH_INVALID_COUNTRY_CODE, + Locale.ENGLISH)); + } +} diff --git a/resources/PhoneNumberMetaData.xml b/resources/PhoneNumberMetaData.xml index 58f31079f..2b8dd9610 100644 --- a/resources/PhoneNumberMetaData.xml +++ b/resources/PhoneNumberMetaData.xml @@ -3939,12 +3939,12 @@ - + $1 $2 - [27-9]\d{7} + [257-9]\d{7} \d{8} @@ -3952,29 +3952,36 @@ 22345678 - - - 7777\d{4}| - 9(?: - [69]\d| - 7[67] - )\d{5} - + + 9[5-79]\d{6} 96123456 - 8000\d{4} + 800\d{5} 80001234 - 9009\d{4} - 90091234 + 90[09]\d{5} + 90012345 + + 80[1-9]\d{5} + 80112345 + 700\d{5} 70012345 + + + + (?: + 50| + 77 + )\d{6} + + 77123456 + @@ -4069,8 +4076,13 @@ - 60[1-8]\d{6}| - 7[2379]\d{7} + (?: + 60[1-8]| + 7(?: + 0[25]| + [2379]\d + ) + )\d{6} 601123456 @@ -4079,7 +4091,13 @@ 800123456 - 90[0689]\d{6} + + + 9(?: + 0[05689]| + 76 + )\d{6} + 900123456 @@ -4090,6 +4108,10 @@ 70[01]\d{6} 700123456 + + 9[17]0\d{6} + 910123456 + @@ -4960,8 +4982,23 @@ \d{9} - [89][1-8]\d{7} - 812345678 + + (?: + 8(?: + [13]0| + [28][0-8]| + [47][1-9]| + 5[01346-9]| + 6[0457-9] + )| + 9(?: + [1238][0-8]| + [47][1-9]| + [56]\d + ) + )\d{6} + + 810123456 6\d{8} @@ -5583,12 +5620,26 @@ nationalPrefix="0" preferredExtnPrefix=" x" nationalPrefixFormattingRule="$NP$FG" mainCountryForCode="true"> - + 2| 5[56]| - 7[06] + 7(?: + 0| + 6[013-9] + ) + + + 2| + 5[56]| + 7(?: + 0| + 6(?: + [013-9]| + 2[0-35-9] + ) + ) $1 $2 $3 @@ -5650,9 +5701,20 @@ 1 $1 $2 - + - 7[1-5789] + + 7(?: + [1-5789]| + 62 + ) + + + 7(?: + [1-5789]| + 624 + ) + $1 $2 @@ -6337,7 +6399,49 @@ - + + + + + + + $1 $2 $3 $4 + + + + [56]\d{8} + \d{9} + + + + 594(?: + 10| + 2[012457-9]| + 3[0-57-9]| + 4[3-9]| + 5[7-9]| + 6[0-3]| + 9[014] + )\d{4} + + 594101234 + + + + 694(?: + [04][0-7]| + 1[0-5]| + 2[0-46-9]| + 38| + 9\d + )\d{4} + + 694201234 + + @@ -6779,7 +6883,7 @@ - + [235] $1 $2 $3 @@ -6790,9 +6894,7 @@ [23589]\d{8} - - \d{6,9} + \d{9} @@ -9402,38 +9504,53 @@ 876(?: - (?: - 5[0-26]| - 6\d - )\d{5}| - (?: - 7(?: - 0[2-689]| - [1-6]\d| - 8[056]| - 9[45] - )| - 9(?: - 0[1-8]| - 1[02378]| - [2-8]\d| - 9[2-468] - ) - )\d{4} - ) + 5(?: + 0[12]| + 1[0-468]| + 2[35]| + 63 + )| + 6(?: + 0[1-3579]| + 1[027]| + 2[3-5]| + 34| + [45]0| + 63| + 7[05]| + 8[04]| + 9[4-9] + ) + 7(?: + 0[2-689]| + [1-6]\d| + 8[056]| + 9[45] + )| + 9(?: + 0[1-8]| + 1[02378]| + [2-8]\d| + 9[2-468] + ) + )\d{4} 8765123456 - + 876(?: (?: 2[178]| [348]\d| - 5[78] )\d| + 5(?: + 27| + 66| + [78]\d + )| 7(?: 0[07]| 7\d| @@ -10846,8 +10963,63 @@ - + + + + + 1 + $1 $2 $3 + + + 2 + $1 $2 $3 + + + 8 + $1 $2 $3 + + + + + 1\d{9}| + [28]\d{7} + + + \d{6,8}| + \d{10} + + + + + + 2(?: + [0-24-9]\d{2}| + 3(?: + [0-79]\d| + 8[02-9] + ) + )\d{4} + + \d{8} + 23821234 + + + + + 2\d{7}| + 85\d{6} + + \d{6,8} + 21234567 + + + 19[123]\d{7} + \d{10} + 1921234567 + @@ -13113,6 +13285,7 @@ + @@ -13127,10 +13300,13 @@ 596(?: - 3[0789]| - 4[28]| + 0[2-5]| + [12]0| + 3[05-9]| + 4[024-8]| [5-7]\d| - 9[67] + 89| + 9[4-8] )\d{4} 596301234 @@ -13138,9 +13314,9 @@ 696(?: - [2-49]\d| - 7[0-4]| - 8[0-6] + [0-479]\d| + 5[01]| + 8[0-689] )\d{4} 696201234 @@ -14032,8 +14208,59 @@ - + + + + + + $1.$2.$3 + + + + [2-47-9]\d{5} + \d{6} + + + + + (?: + 2[03-9]| + 35| + 4[1-7]| + 88 + )\d{4} + + 201234 + + + + (?: + 7[4-9]| + 8[0-79]| + 9\d + )\d{4} + + 751234 + + + + + 1(?: + 0(?: + 0[06]| + 1[02-46]| + 20| + 3[0125]| + 42| + 5[058]| + 77 + )| + [5-8] + ) + + \d{2,4} + 15 + @@ -14725,62 +14952,260 @@ + + - - - - - - - - 1 - $1 $2 - - - [4-8] - $1 $2 + + [1-57-9] + $1-$2 - - - 9 - $1 $2 $3 + + 6 + $1-$2 - [14-9]\d{7,8} - \d{6,9} + [1-9]\d{6,7} + \d{7,8} + + + (?: - 1\d| - 4[1-4]| - 5[1-46]| - 6[1-7]| - 7[2-46]| - 8[2-4] - )\d{6} - - \d{6,8} - 11234567 - - - 9\d{8} - \d{9} - 912345678 - - - - - - - - + 1(?: + 0[02-579]| + 19| + 23| + 3[03]| + 4[479]| + 5[57]| + 65| + 7[016-8]| + 8[58]| + 9[1-49] + )| + 2(?: + [0235679]\d| + 1[0-7]| + 4[04-9]| + 8[028] + )| + 3(?: + 0[0-7]| + 1[14-7]| + 2[0-3]| + 3[03]| + 4[0457]| + 5[56]| + 6[068]| + 7[078]| + 80| + 9[0-79] + )| + 4(?: + 3[013-59]| + 4\d| + 7[0-689] + )| + 5(?: + [01]\d| + 2[0-7]| + [56]0| + 79 + )| + 7(?: + 09| + 2[0-267]| + [34]0| + 5[6-9]| + 7[0-24-7]| + 8[89]| + 99 + )| + 8(?: + [34]\d| + 5[0-5]| + 8[02] + )| + 9(?: + 0[78]| + 1[0178]| + 2[0378]| + 3[379]| + 40| + 5[0489]| + 6[06-9]| + 7[046-9]| + 8[36-8]| + 9[1-9] + ) + )\d{4} + + \d{7} + 2001234 + + + + + (?: + 161| + 21[89]| + 8(?: + 1[01]| + 7[23] + ) + )\d{4}| + 6(?: + [04-8]\d| + 1[0-5]| + 2[0-4]| + 3[7-9]| + 9[0-8] + )\d{5} + + 60012345 + + + 80[09]\d{4} + \d{7} + 8001234 + + + + + (?: + 779| + 8(?: + 2[235]| + 60| + 7[578]| + 86| + 95 + )| + 9(?: + 0[0-2]| + 81 + ) + )\d{4} + + \d{7} + 8601234 + + + + 10[2-4]| + 911 + + \d{3} + 102 + + + + + + + + + + 1 + $1 $2 + + + [4-8] + $1 $2 + + + + 9 + $1 $2 $3 + + + + [14-9]\d{7,8} + \d{6,9} + + + + (?: + 1\d| + 4[1-4]| + 5[1-46]| + 6[1-7]| + 7[2-46]| + 8[2-4] + )\d{6} + + \d{6,8} + 11234567 + + + 9\d{8} + \d{9} + 912345678 + + + + + + + + + $1 $2 $3 + + + + [2-9]\d{5} + \d{6} + + + + (?: + 36| + 44 + )\d{4} + + 441234 + + + + + (?: + 36\d| + 4(?: + [02-9]\d| + 1[02-9] + )| + [5689]\d{2} + )\d{3} + + 401234 + + + + (?: + [27]\d{3}| + 3[0-49]\d{2}| + 411[3-6] + )\d{2} + + 212345 + + + + @@ -15587,12 +16012,188 @@ - + + + + + $1 $2 + + + + [2-8]\d{6} + \d{7} + + + + 2552255| + (?: + 277| + 345| + 488| + 5(?: + 35| + 44| + 87 + )| + 6(?: + 22| + 54| + 79 + )| + 7(?: + 33| + 47 + )| + 8(?: + 24| + 55| + 76 + ) + )\d{4} + + 2771234 + + + + (?: + 6[234689]0| + 77[45789] + )\d{4} + + 6201234 + + + + 911 + \d{3} + 911 + - + + + + + + + + + (?: + [26]1| + 3[289]| + 4[124678]| + 7[123]| + 8[1236] + ) + + $1 $2 + + + [2-9]0 + $1 $2 + + + 9[1-9] + $1 $2 + + + + 8700 + $1 $2 $3 + + + + [2-8][1-9] + $1 $2 + + + + + 5[0-5]\d{4,7}| + [2-46-9]\d{5,8} + + \d{5,9} + + + + (?: + [26]1| + 3[289]| + 4[124678]| + 7[123]| + 8[1236] + )\d{5,7}| + (?: + 2(?: + 2[4568]| + 7[15]| + 9[1-5] + )| + 3(?: + 18| + 3[167]| + 4[2357]| + 51 + )| + 4(?: + 18| + 2[45]| + 3[12]| + 5[13]| + 64| + 71| + 9[1-47] + )| + 5(?: + [1-4]\d| + 5[0234] + )| + 6(?: + 3[1-3]| + 44| + 7[1-4678] + )| + 7(?: + 17| + 4[0-4]| + 6[1-578]| + 75| + 8[0-8] + )| + 858 + )\d{5,6} + + 212345678 + + + + 9(?: + 61| + 7[12356]| + 8[1-5]| + 9[1235] + )\d{6} + + \d{9} + 961456789 + + + 8700[0-4]\d{4} + \d{9} + 870012345 + + + [2-9]0\d{4,7} + \d{6,9} + 201234567 + + + 1[1-4]\d + \d{3} + 123 + @@ -15996,7 +16597,71 @@ - + + + + + [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-7] + )\d{4}| + 8[48]\d{5} + + \d{7} + 7421234 + + + 1[38]\d{3} + \d{5} + 18123 + + + 5[12]\d{3} + \d{5} + 51123 + + + + 1(?: + 0[02-79]| + 1[12]| + 2[0-26]| + 4[189]| + 68 + )| + 9(?: + [01]1| + 22| + 33| + 55| + 77| + 88| + 99 + ) + + \d{3} + 100 + @@ -16918,7 +17583,64 @@ + + + + + + [2-4]| + 5[2-58] + + $1-$2 + + + 56 + $1-$2-$3 + + + [6-8] + $1-$2 + + + + [2-8]\d{5,6} + \d{6,7} + + + + + (?: + 2[1-3]| + 3[0-7]| + 4\d| + 5[2-58]| + 68\d + )\d{4} + + 211234 + + + + + (?: + 7[1245]| + 8[1-9] + )\d{5} + + \d{7} + 7412345 + + + 56\d{4} + \d{6} + 561234 + + + 1\d{2,3} + \d{3,4} + 1234 + @@ -17525,9 +18247,8 @@ (?: - 2[0-7]| - 40| - 9\d + [29]\d| + 4[01] )\d{6} 20123456 @@ -17541,7 +18262,65 @@ - + + + + + + + [1-6]| + 7[0-4]| + 8[05] + + $1-$2 + + + + 7[5-9]| + 8[7-9] + + $1 $2 + + + 0 + $1 $2 + + + + [02-8]\d{4,6} + \d{5,7} + + + + (?: + 2\d| + 3[1-8]| + 4[1-4]| + [56]0| + 7[0149]| + 8[05] + )\d{3} + + \d{5} + 20123 + + + + + (?: + 7[578]| + 8[7-9] + )\d{5} + + \d{7} + 7715123 + + + 0800\d{3} + \d{7} + 0800222 + @@ -18361,8 +19140,67 @@ - + + + + + + + + + [24] + $1 $2 + + + + 9[1-9] + $1 $2 $3 + + + [89]0 + $1 $2 + + + + [2489]\d{6,7} + \d{7,8} + + + + 2\d{7}| + 4[2-7]\d{6} + + 21231234 + + + 9[13-9]\d{6} + \d{8} + 94231234 + + + 80[05]\d{4} + \d{7} + 8001234 + + + 90[0-8]\d{4} + \d{7} + 9001234 + + + + 1(?: + 0[4-9]| + 1[2368]| + 2[0-3568] + )| + 911 + + \d{3} + 104 + @@ -18661,7 +19499,7 @@ 340(?: 2(?: 01| - 2[07]| + 2[067]| 36| 44| 77 @@ -18698,7 +19536,7 @@ 340(?: 2(?: 01| - 2[07]| + 2[067]| 36| 44| 77 @@ -18887,7 +19725,53 @@ + + + + + [57] + $1 $2 + + + + [2-578]\d{4,6} + \d{5,7} + + + + (?: + 2[2-9]\d| + 3(?: + [67]\d| + 8[0-8] + )| + 48[4-9]| + 88\d + )\d{2} + + \d{5} + 22123 + + + + (?: + 5(?: + 7[2-5]| + [3-69]\d + )| + 7[013-7]\d + )\d{4} + + \d{7} + 5912345 + + + + 30\d{3} + \d{5} + 30123 +