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

Data Split & Organize & Memoize #51

Open
nofxx opened this issue Dec 29, 2014 · 0 comments
Open

Data Split & Organize & Memoize #51

nofxx opened this issue Dec 29, 2014 · 0 comments

Comments

@nofxx
Copy link

nofxx commented Dec 29, 2014

Up to discussion, but if each country code had it N.yml file?
It may get loaded in a JIT fashion, so country would load to memory only codes used.
And on each yml you could add comments that would really help figuring out the regexes.

How it would look for 55, Brazil:

# This file should be named 55.yml
# Local numbers start with 2 up to 9.
# Tool free start with 800
55:
  iso_code: BR
  national_dialing_prefix: '0'
  international_dialing_prefix: '00'
  area_code: ((1[1-9]|2[147]|3[1-578]|4[1-9]|5[1-5]|6[1235-9]|7[134579]|8[1-8]|9[12568])|0[3589]00)
  local_number_format: ([1-5]\d{7}|9?[6-9]\d{7}|\d{7})
  mobile_format: ([129][1-9]9|[3-9][1-9])[6-9]\d{7}
  number_format: \d{10,11}
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

1 participant