Skip to content

Commit d486b08

Browse files
Update the validation patterns
1 parent 281d46b commit d486b08

File tree

3 files changed

+64
-170
lines changed

3 files changed

+64
-170
lines changed

resources/metadata.xml

Lines changed: 16 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@
796796
<mobile>
797797
<possibleLengths national="9"/>
798798
<exampleNumber>923123456</exampleNumber>
799-
<nationalNumberPattern>9[1-59]\d{7}</nationalNumberPattern>
799+
<nationalNumberPattern>9[1-579]\d{7}</nationalNumberPattern>
800800
</mobile>
801801
</territory>
802802

@@ -10560,7 +10560,7 @@
1056010560
1(?:
1056110561
3(?:
1056210562
[0-58]\d\d|
10563-
73[0235]
10563+
73[0-35]
1056410564
)|
1056510565
4(?:
1056610566
(?:
@@ -10594,7 +10594,7 @@
1059410594
)\d|
1059510595
1(?:
1059610596
[0-7]\d|
10597-
8[0-2]
10597+
8[0-3]
1059810598
)
1059910599
)|
1060010600
(?:
@@ -12421,7 +12421,8 @@
1242112421
7(?:
1242212422
[013]\d|
1242312423
2[0-25-8]|
12424-
4[0-29]
12424+
4[0-29]|
12425+
5[1-9]
1242512426
)
1242612427
)\d{4}
1242712428
</nationalNumberPattern>
@@ -12511,7 +12512,7 @@
1251112512
8(?:
1251212513
4[0-8]|
1251312514
[59]\d|
12514-
6[01]
12515+
6[0-2]
1251512516
)
1251612517
)|
1251712518
58(?:
@@ -21322,79 +21323,34 @@
2132221323
<!-- http://en.wikipedia.org/wiki/%2B52 -->
2132321324
<!-- http://en.wikipedia.org/wiki/Premium-rate_telephone_number#Mexico -->
2132421325
<!-- http://en.wikipedia.org/wiki/Toll-free_telephone_number -->
21325-
<!-- When a number starts with 01 or 02, we remove the prefixes; when a number starts with 044
21326-
or 045 followed by 10 digits, we replace the prefixes with 1. This way all the mobile
21327-
numbers, regardless of whether they are written in international format (leading 1) or
21328-
national format (leading 044/045), will be parsed into the same form. -->
21326+
<!-- Dialling tokens 01, 02, 044, 045 and 1 are removed as they are no longer valid since
21327+
August 2019. -->
2132921328
<territory id="MX" countryCode="52" preferredInternationalPrefix="00"
21330-
internationalPrefix="0[09]" nationalPrefix="01"
21331-
nationalPrefixForParsing="0(?:[12]|4[45])|1" mobileNumberPortableRegion="true">
21329+
internationalPrefix="0[09]" mobileNumberPortableRegion="true">
2133221330
<availableFormats>
2133321331
<!-- 5-digit shortcodes (very rare). -->
2133421332
<numberFormat pattern="(\d{5})">
2133521333
<leadingDigits>53</leadingDigits>
2133621334
<format>$1</format>
2133721335
<intlFormat>NA</intlFormat>
2133821336
</numberFormat>
21339-
<!-- Fixed line (2-digit area codes). -->
21340-
<numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
21337+
<!-- Fixed line (2-digit area codes) and Mobile. -->
21338+
<numberFormat pattern="(\d{2})(\d{4})(\d{4})">
2134121339
<leadingDigits>
2134221340
33|
2134321341
5[56]|
2134421342
81
2134521343
</leadingDigits>
2134621344
<format>$1 $2 $3</format>
2134721345
</numberFormat>
21348-
<!-- Fixed line (3-digit area codes) and other non-mobile numbers. -->
21349-
<numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
21346+
<!-- Fixed line (3-digit area codes), Mobile and all other non geographic numbers. -->
21347+
<numberFormat pattern="(\d{3})(\d{3})(\d{4})">
2135021348
<leadingDigits>[2-9]</leadingDigits>
2135121349
<format>$1 $2 $3</format>
2135221350
</numberFormat>
21353-
<!-- Mobile version of fixed line 2-digit area codes and removing former mobile token 1. -->
21354-
<numberFormat pattern="(\d)(\d{2})(\d{4})(\d{4})"
21355-
nationalPrefixOptionalWhenFormatting="true">
21356-
<leadingDigits>
21357-
1(?:
21358-
33|
21359-
5[56]|
21360-
81
21361-
)
21362-
</leadingDigits>
21363-
<format>$2 $3 $4</format>
21364-
</numberFormat>
21365-
<!-- Mobile version of fixed line 3-digit area codes and removing former mobile token 1. -->
21366-
<numberFormat pattern="(\d)(\d{3})(\d{3})(\d{4})"
21367-
nationalPrefixOptionalWhenFormatting="true">
21368-
<leadingDigits>1</leadingDigits>
21369-
<format>$2 $3 $4</format>
21370-
</numberFormat>
2137121351
</availableFormats>
2137221352
<generalDesc>
21373-
<nationalNumberPattern>
21374-
1(?:
21375-
(?:
21376-
22|
21377-
44|
21378-
7[27]|
21379-
87|
21380-
9[69]
21381-
)[1-9]|
21382-
65[0-689]
21383-
)\d{7}|
21384-
(?:
21385-
1(?:
21386-
[01]\d|
21387-
2[13-9]|
21388-
[35][1-9]|
21389-
4[0-35-9]|
21390-
6[0-46-9]|
21391-
7[013-689]|
21392-
8[1-69]|
21393-
9[1-578]
21394-
)|
21395-
[2-9]\d
21396-
)\d{8}
21397-
</nationalNumberPattern>
21353+
<nationalNumberPattern>[2-9]\d{9}</nationalNumberPattern>
2139821354
</generalDesc>
2139921355
<!-- http://en.wikipedia.org/wiki/Area_codes_in_Mexico_by_code -->
2140021356
<!-- Also covering fixed satellite service numbers (prefixes: 200 and 201). -->
@@ -21473,73 +21429,11 @@
2147321429
<!-- Fixed satellite service numbers are not included here, although many other prefixes from
2147421430
the fixedLine pattern are. -->
2147521431
<mobile>
21476-
<possibleLengths national="10,11" localOnly="7,8"/>
21477-
<exampleNumber>12221234567</exampleNumber>
21432+
<possibleLengths national="10" localOnly="7,8"/>
21433+
<exampleNumber>2221234567</exampleNumber>
2147821434
<nationalNumberPattern>
2147921435
657[12]\d{6}|
2148021436
(?:
21481-
1(?:
21482-
2(?:
21483-
2[1-9]|
21484-
3[1-35-8]|
21485-
4[13-9]|
21486-
7[1-689]|
21487-
8[1-578]|
21488-
9[467]
21489-
)|
21490-
3(?:
21491-
1[1-79]|
21492-
[2458][1-9]|
21493-
3\d|
21494-
7[1-8]|
21495-
9[1-5]
21496-
)|
21497-
4(?:
21498-
1[1-57-9]|
21499-
[24-7][1-9]|
21500-
3[1-8]|
21501-
8[1-35-9]|
21502-
9[2-689]
21503-
)|
21504-
5(?:
21505-
[56]\d|
21506-
88|
21507-
9[1-79]
21508-
)|
21509-
6(?:
21510-
1[2-68]|
21511-
[2-4][1-9]|
21512-
5[1-3689]|
21513-
6[1-57-9]|
21514-
7[1-7]|
21515-
8[67]|
21516-
9[4-8]
21517-
)|
21518-
7(?:
21519-
[1-467][1-9]|
21520-
5[13-9]|
21521-
8[1-69]|
21522-
9[17]
21523-
)|
21524-
8(?:
21525-
1\d|
21526-
2[13-689]|
21527-
3[1-6]|
21528-
4[124-6]|
21529-
6[1246-9]|
21530-
7[1-378]|
21531-
9[12479]
21532-
)|
21533-
9(?:
21534-
1[346-9]|
21535-
2[1-4]|
21536-
3[2-46-8]|
21537-
5[1348]|
21538-
[69][1-9]|
21539-
7[12]|
21540-
8[1-8]
21541-
)
21542-
)|
2154321437
2(?:
2154421438
2\d|
2154521439
3[1-35-8]|

0 commit comments

Comments
 (0)