Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from LuhalvesBR/feature/spanish-area-codes
- Loading branch information
Showing
55 changed files
with
878 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,67 @@ | ||
defmodule Phone.ES do | ||
@moduledoc false | ||
@doc """ | ||
Telephone Numbers rules based in a government file called | ||
"El Plan Nacional de Numeración - Guía práctica de usuario" | ||
Provincies and acronyms from ISO 3166-2:ES | ||
""" | ||
|
||
use Helper.Country | ||
|
||
def regex, do: ~r/^(34)()(.{9})/ | ||
def country, do: "Spain" | ||
def a2, do: "ES" | ||
def a3, do: "ESP" | ||
|
||
matcher(:regex, ["34"]) | ||
matcher(:modules, [ | ||
Phone.ES.A, | ||
Phone.ES.AB, | ||
Phone.ES.AL, | ||
Phone.ES.AV, | ||
Phone.ES.B, | ||
Phone.ES.BA, | ||
Phone.ES.BI, | ||
Phone.ES.BU, | ||
Phone.ES.C, | ||
Phone.ES.CA, | ||
Phone.ES.CC, | ||
Phone.ES.CO, | ||
Phone.ES.CR, | ||
Phone.ES.CS, | ||
Phone.ES.CU, | ||
Phone.ES.GC, | ||
Phone.ES.GI, | ||
Phone.ES.GR, | ||
Phone.ES.GU, | ||
Phone.ES.H, | ||
Phone.ES.HU, | ||
Phone.ES.J, | ||
Phone.ES.L, | ||
Phone.ES.LE, | ||
Phone.ES.LO, | ||
Phone.ES.LU, | ||
Phone.ES.M, | ||
Phone.ES.MA, | ||
Phone.ES.MU, | ||
Phone.ES.NA, | ||
Phone.ES.O, | ||
Phone.ES.OR, | ||
Phone.ES.P, | ||
Phone.ES.PM, | ||
Phone.ES.PO, | ||
Phone.ES.S, | ||
Phone.ES.SA, | ||
Phone.ES.SE, | ||
Phone.ES.SG, | ||
Phone.ES.SO, | ||
Phone.ES.SS, | ||
Phone.ES.T, | ||
Phone.ES.TE, | ||
Phone.ES.TF, | ||
Phone.ES.TO, | ||
Phone.ES.V, | ||
Phone.ES.VA, | ||
Phone.ES.VI, | ||
Phone.ES.Z, | ||
Phone.ES.ZA, | ||
]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.A do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(96[5-6]|86[5-6])(.{6})/ | ||
def area_name, do: "Alicante" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "A" | ||
|
||
matcher(["34965", "34966", "34865", "34866"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.AB do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(967|867)(.{6})/ | ||
def area_name, do: "Albacete" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "AB" | ||
|
||
matcher(["34967", "34867"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.AL do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(950|850)(.{6})/ | ||
def area_name, do: "Almería" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "AL" | ||
|
||
matcher(["34950", "34850"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.AV do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(920|820)(.{6})/ | ||
def area_name, do: "Ávila" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "AV" | ||
|
||
matcher(["34920", "34820"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
defmodule Phone.ES.B do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(93[0-9]|83[0-9])(.{6})/ | ||
def area_name, do: "Barcelona" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "B" | ||
|
||
matcher([ | ||
"34930", | ||
"34931", | ||
"34932", | ||
"34933", | ||
"34934", | ||
"34935", | ||
"34936", | ||
"34937", | ||
"34938", | ||
"34939", | ||
"34830", | ||
"34831", | ||
"34832", | ||
"34833", | ||
"34834", | ||
"34835", | ||
"34836", | ||
"34837", | ||
"34838", | ||
"34839" | ||
]) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.BA do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(924|824)(.{6})/ | ||
def area_name, do: "Badajoz" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "BA" | ||
|
||
matcher(["34924", "34824"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.BI do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(944|946|844|846)(.{6})/ | ||
def area_name, do: "Bizkaia" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "BI" | ||
|
||
matcher(["34944", "34946", "34844", "34846"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.BU do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(947|847)(.{6})/ | ||
def area_name, do: "Burgos" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "BU" | ||
|
||
matcher(["34947", "34847"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.C do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(981|881)(.{6})/ | ||
def area_name, do: "A Coruña" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "C" | ||
|
||
matcher(["34981", "34881"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.CA do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(956|856)(.{6})/ | ||
def area_name, do: "Cádiz" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "CA" | ||
|
||
matcher(["34956", "34856"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.CC do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(927|827)(.{6})/ | ||
def area_name, do: "Cáceres" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "CC" | ||
|
||
matcher(["34927", "34827"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.CO do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(957|857)(.{6})/ | ||
def area_name, do: "Córdoba" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "CO" | ||
|
||
matcher(["34957", "34857"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.CR do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(926|826)(.{6})/ | ||
def area_name, do: "Ciudad Real" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "CR" | ||
|
||
matcher(["34926", "34826"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.CS do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(964|864)(.{6})/ | ||
def area_name, do: "Castellón" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "CS" | ||
|
||
matcher(["34964", "34864"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.CU do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(969|869)(.{6})/ | ||
def area_name, do: "Cuenca" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "CU" | ||
|
||
matcher(["34969", "34869"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.GC do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(928|828)(.{6})/ | ||
def area_name, do: "Las Palmas" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "GC" | ||
|
||
matcher(["34928", "34828"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.GI do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(972|872)(.{6})/ | ||
def area_name, do: "Girona" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "GI" | ||
|
||
matcher(["34972", "34872"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.GR do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(958|858)(.{6})/ | ||
def area_name, do: "Granada" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "GR" | ||
|
||
matcher(["34958", "34858"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.GU do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(949|849)(.{6})/ | ||
def area_name, do: "Guadalajara" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "GU" | ||
|
||
matcher(["34949", "34849"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.H do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(959|859)(.{6})/ | ||
def area_name, do: "Huelva" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "H" | ||
|
||
matcher(["34959", "34859"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Phone.ES.HU do | ||
@moduledoc false | ||
|
||
use Helper.Area | ||
|
||
def regex, do: ~r/^(34)(974|874)(.{6})/ | ||
def area_name, do: "Huesca" | ||
def area_type, do: "province" | ||
def area_abbreviation, do: "HU" | ||
|
||
matcher(["34974", "34874"]) | ||
end |
Oops, something went wrong.