Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue parsing Irish phone numbers #88

Closed
aaronrenner opened this issue Dec 15, 2016 · 4 comments
Closed

Issue parsing Irish phone numbers #88

aaronrenner opened this issue Dec 15, 2016 · 4 comments

Comments

@aaronrenner
Copy link
Contributor

I am having an issue getting irish phone numbers to parse correctly. I'm not sure what part of the phone number is the "area code", but here are some sample phone numbers.

+353 1 276 1923 - McDonald's, Bray, County Wicklow, Ireland
+353 402 39874 - McDonald's, Arklow, County Wicklow, Ireland
+353 1 872 4487 - McDonald's, 62 O'Connell Street Upper Dublin Dublin 1 O'Connell Street Upper, North City, Dublin 1, Ireland

Also what do you think about creating a test file for each country with sample phone numbers in it? For example, Ireland's tests would be in test/phone/ie_test.exs.

@aaronrenner
Copy link
Contributor Author

aaronrenner commented Dec 15, 2016

Here's a wikipedia article about Irish phone numbers: https://en.wikipedia.org/wiki/Telephone_numbers_in_the_Republic_of_Ireland. It looks like they have some interesting area codes. It looks like Dublin's area code is 1, and Arklow's area code is 402. In this document local numbers appear to be dialed with 01 xxx xxxx and when using e164 format, the same number would be dialed 353 1 xxx xxxx.

@fcevado
Copy link
Owner

fcevado commented Dec 17, 2016

I'm updating the regex, I guess something like that will work for a while:
^(353)(1|402|404|505|90|[2-9][1-9])(.{5,7})$
I'll update the master, but I'll try to finish my changes to increase performance this weekend so I can put everything in one release.

@fcevado
Copy link
Owner

fcevado commented Dec 17, 2016

Also what do you think about creating a test file for each country with sample phone numbers in it? For example, Ireland's tests would be in test/phone/ie_test.exs

I had thought that a while ago, I was planning to do that on this end of the year. Initially I would do that only for the countries with area code specifications(all from NANP and Brazil by now, I think I can do Ireland too, since it's a small one).

@aaronrenner
Copy link
Contributor Author

Awesome! Thanks for your help with this. I'll go ahead and close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants