haberbyte/phoney

UK data, +44.

Closed this issue · 2 comments

https://github.com/habermann24/phoney/blob/master/lib/data/regions.yml

This entry for +44 (in both gb and uk):

  • { :type: 0, :min: 13873, :max: 13873, :total_digits: 9, :areacode_length: 5, :areacode_offset: 0, :format: :"XXXXX XXXXXXX XXXX XXXX" }

should be replaced with this:

  • { :type: 0, :min: 13873, :max: 13873, :total_digits: 10, :areacode_length: 5, :areacode_offset: 0, :format: :"XXXXX XXXXX" }

This line is missing from the data:

  • { :type: 0, :min: 19467, :max: 19467, :total_digits: 10, :areacode_length: 5, :areacode_offset: 0, :format: :"XXXXX XXXXX" }

The gb/uk data also does not appear to cater for 9-digit numbers beginning 500 or 800, nor for 7-digit numbers beginning 800 1111 or 845 46 47x.

Numbers in gb/uk beginning 500 are always 9 digits long. Numbers beginning 800 can be 7, 9 or 10 digits long. Numbers beginning 845 can be 7 or 10 digits long. All other numbers beginning 2, 3, 5, 7, 8, 9 are always 10 digits long.

There's also 40 areas in gb/uk where some numbers beginning 1xxx have only 9 digits, not the usual 10 (i.e. there is a mix of 9 and 10 digit numbers within the same area). One area code beginning 16977 also has some 9 digit numbers (those beginning 16977 2xxx and 16977 3xxx) while the rest of the numbers within the area have 10 digits.

http://www.aa-asterisk.org.uk/index.php/Number_format
http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers

I'm also one of the contributors to Google's libphonenumber project.

awesome

Amazed that this was still open and unfixed after two years.

Fixed in issue #7.