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

Italy numbers requiring a 0 prefix to be split #152

Closed
taf2 opened this issue Apr 17, 2014 · 2 comments
Closed

Italy numbers requiring a 0 prefix to be split #152

taf2 opened this issue Apr 17, 2014 · 2 comments

Comments

@taf2
Copy link

taf2 commented Apr 17, 2014

For example:

Phony.split("39694805xxx") -> ['39']

vs

Phony.split("390694805xxx") -> ["39", "06", "9480", "5xxx"]

I'm not sure that the leading zero before the country code is always necessary. Some phone carriers strip this out.

@floere
Copy link
Owner

floere commented Apr 20, 2014

According to http://en.wikipedia.org/wiki/Telephone_numbers_in_Italy, the 0 is necessary, and is in use for landlines. Perhaps we can make Phony more permissive – the former split in your example is not the "best effort" phony that I'd like it to be.

@floere floere closed this as completed in b700ab4 Apr 20, 2014
floere added a commit that referenced this issue Apr 20, 2014
@floere
Copy link
Owner

floere commented Apr 20, 2014

So at 2.2.5 we're here

it 'best effort #152' do
described_class.split('39694805123').should == ['39', '694805123', []]
end
:

it 'best effort #152' do
  described_class.split('39694805123').should == ['39', '694805123', []]
end

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

No branches or pull requests

2 participants