From 57d629ab1ab3173af25bde9c78bc80edd1686617 Mon Sep 17 00:00:00 2001 From: Igor Florian Date: Tue, 2 Jul 2019 17:58:09 -0300 Subject: [PATCH] Increase Italian digits number Italy doesn't have a specific length, they may vary between 3 up to 12 digits. References: - https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers#Italy - https://en.wikipedia.org/wiki/Telephone_numbers_in_Italy#Number_formats --- CHANGELOG.md | 4 ++++ lib/phone/it.ex | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec4db0f..c08a6c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## v0.4.5 + +* Fix Italy regex to consider 3 minimum digits and max 12 + ## v0.4.4: * Fix Australia regex * Fix Ireland regex diff --git a/lib/phone/it.ex b/lib/phone/it.ex index 6e2b0c5..75c1930 100644 --- a/lib/phone/it.ex +++ b/lib/phone/it.ex @@ -3,7 +3,7 @@ defmodule Phone.IT do use Helper.Country - def regex, do: ~r/^(39)()(.{9,10})/ + def regex, do: ~r/^(39)()(.{3,12})/ def country, do: "Italy" def a2, do: "IT" def a3, do: "ITA"