phone 1.2.3 → 1.3.0.beta0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.document +3 -0
  3. data/.gitignore +5 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +14 -0
  6. data/.yardopts +1 -0
  7. data/ChangeLog.md +50 -0
  8. data/Gemfile +11 -0
  9. data/LICENSE.txt +22 -0
  10. data/README.md +183 -0
  11. data/Rakefile +38 -0
  12. data/data/{phone_countries.yml → phone/countries.yml} +16 -14
  13. data/lib/phone.rb +75 -53
  14. data/lib/phone/country.rb +45 -0
  15. data/lib/{errors.rb → phone/errors.rb} +0 -0
  16. data/lib/phone/version.rb +4 -0
  17. data/phone.gemspec +25 -0
  18. data/test/countries/au_test.rb +11 -11
  19. data/test/countries/ba_test.rb +4 -4
  20. data/test/countries/be_test.rb +12 -11
  21. data/test/countries/de_test.rb +7 -7
  22. data/test/countries/es_test.rb +33 -0
  23. data/test/countries/fr_test.rb +5 -5
  24. data/test/countries/gb_test.rb +42 -41
  25. data/test/countries/hr_test.rb +14 -14
  26. data/test/countries/hu_test.rb +5 -5
  27. data/test/countries/ie_test.rb +20 -0
  28. data/test/countries/nl_test.rb +43 -43
  29. data/test/countries/nz_test.rb +8 -0
  30. data/test/countries/pt_test.rb +18 -18
  31. data/test/countries/rs_test.rb +7 -7
  32. data/test/countries/se_test.rb +44 -43
  33. data/test/countries/si_test.rb +7 -7
  34. data/test/countries/ua_test.rb +4 -4
  35. data/test/countries/us_test.rb +6 -6
  36. data/test/countries/uy_test.rb +22 -0
  37. data/test/countries/za_test.rb +4 -4
  38. data/test/extension_test.rb +3 -3
  39. data/test/helper.rb +41 -0
  40. data/test/phone_test.rb +99 -53
  41. data/test_usa_phones_with_extensions.csv +99 -0
  42. metadata +112 -30
  43. data/LICENSE +0 -19
  44. data/Readme.rdoc +0 -126
  45. data/lib/country.rb +0 -36
  46. data/lib/support.rb +0 -78
  47. data/test/test_helper.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f34c77402ea12b6fafbda205f46bb897b0996c66
4
- data.tar.gz: f29f3fd69c0f6415ba76d1d16da01279cdc76b8e
3
+ metadata.gz: 968e42477f674e7f318948884bc9af50d369e934
4
+ data.tar.gz: fd0e865669d8ba5c3031be42f5bb8b0af92c11f3
5
5
  SHA512:
6
- metadata.gz: c94ec8394ccd7a4485d56caa2e701d147f241745909622b59a08c05e4d91733f01b21088e7c81d53cdb1a55efb5d73926c46f3abe9bf3496ae8d4a8bc9fa1087
7
- data.tar.gz: 23f8e3d274b53614a54964c87bd7cc09a7ef103d47eccf1d53db75a444a986e6e40d8cf80dc657ed0febb7a0a48ec2a631fab8197b0e7f7a5c9bf6016685235c
6
+ metadata.gz: 920a4b87ec5e07f39d87141d51e9cf916ff20ea833e0d26e2ae98ff267a54d6505acda34b1f5db3750dc60bd2c3756b9c9dfdd7f53664bcabb876805ea2d0d21
7
+ data.tar.gz: 6dd4129fbd34830c5ca6ce4728ebaf1584878660bf8d8e80a627ceb369aec1d0bf28dddcb76770d0ddb191ca49ce8fa606a74960954a60c4cd889982a18c3386
@@ -0,0 +1,3 @@
1
+ -
2
+ ChangeLog.md
3
+ LICENSE.txt
@@ -0,0 +1,5 @@
1
+ Gemfile.lock
2
+ doc/
3
+ pkg/
4
+ tmp/
5
+ vendor/cache/*.gem
@@ -0,0 +1 @@
1
+ 2.0.0
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ bundler_args: --without doc
3
+ rvm:
4
+ - 1.8.7
5
+ - 1.9.3
6
+ - 2.0.0
7
+ - 2.1.0
8
+ - ruby-head
9
+ - jruby-19mode
10
+ - jruby-head
11
+ - rbx
12
+ notifications:
13
+ email:
14
+ - github@elskwid.net
@@ -0,0 +1 @@
1
+ --markup markdown --title "phone Documentation" --protected
@@ -0,0 +1,50 @@
1
+ # 1.3.0 / (unreleased)
2
+
3
+ * Update README for yaml name and location (pepe)
4
+ * Relocate / rename `data/phone_countries.yml` to `data/phone/countries.yml` (elskwid)
5
+ * [improvement] Add modern gem infrastructure - add bundler, update gemspec, convert to minitest, locate gem files in proper directories, add .ruby-version, update README, update LICENSE.txt, add Changelog.md. (elskwid)
6
+ * [improvement] Memoize country code regex. (tiegz)
7
+ * [improvement] Update regex for: ZA, UY, NL, BE, FR, HU, PT, UA, RS, HR, SE, SI, and BA. (g1smd)
8
+ * [improvement] Add IE support. (dramalho)
9
+ * [improvement] Update #split_to_parts to provide a format override and handle nil parts. (dramalho)
10
+ * [improvement] Add NZ support. (jurgens)
11
+ * [improvement] Add options support to `#valid?`. (soulcutter)
12
+ * [improvement] Remove need for `cattr_accessor`. (elskwid)
13
+ * [fix] Incorrect error raised when missing phone number and add missing test. (elskwid)
14
+ * [fix] Fix extension handling in `::parse`. (elskwid)
15
+ * [improvement] Remove need for ActiveSupport detection. (elskwid)
16
+ * [improvement] Remove monkeypatching support library. (elskwid)
17
+ * [improvement] Add support for Travis CI. (elskwid)
18
+
19
+ # 1.2.3 / 2013-11-16
20
+
21
+ * [fix] Bring changes from v1.1 that were mysteriously missing from repo. (elskwid)
22
+ - README updates
23
+ - Spain area code updates
24
+ - Support 3 character codes for countries
25
+ - Update default area code
26
+ - Update `::normalize`
27
+
28
+ # 1.2.2 / 2013-11-15
29
+
30
+ * Add license to gemspec. (bf4)
31
+
32
+ # 1.2.1 / 2013-10-24
33
+
34
+ * Add errors.rb to gemspec to fix gem. (mtarnovan)
35
+
36
+ # 1.2 / 2013-10-23 (yanked)
37
+
38
+ * Released to capture updates made after version 1.1. (elskwid)
39
+ * Add specific exception classes. (miloshadzic)
40
+
41
+ # 1.1 / 2011-06-23
42
+
43
+ * Implement `==`. (haxney and carr)
44
+ * Update Uraguay area codes and tests. (tiegz)
45
+
46
+ # 1.0 / 2011-04-04
47
+
48
+ * Namespaced library as `Phoner::Phone` (carr)
49
+
50
+ # Previous versions ...
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ group :doc do
6
+ gem "redcarpet"
7
+ end
8
+
9
+ group :test do
10
+ gem "rake"
11
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2010-2013 Tomislav Car
2
+ Modifications copyright (c) 2010 Todd Eichel for Fooala, Inc.
3
+ Copyright (c) 2013 Don Morrison
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,183 @@
1
+ # phone
2
+
3
+ Parsing, validating and creating phone numbers
4
+
5
+ * [Homepage](https://github.com/carr/phone#readme)
6
+ * [Issues](https://github.com/carr/phone/issues)
7
+ * [Documentation](http://rubydoc.info/gems/phone/frames)
8
+ * [Email](mailto:don at elskwid.net)
9
+
10
+ ## Version
11
+
12
+ This documentation is for the unreleased development branch. The current stable version is [1.2.3](https://github.com/carr/phone/tree/v1.2.3)
13
+
14
+ ## Description
15
+
16
+ TODO: Description
17
+
18
+ ## Features
19
+
20
+ ### Automatic country and area code detection
21
+
22
+ Phone does its best to automatically detect the country and area code while parsing. To do this, phone uses data stored in `data/phone/countries.yml`.
23
+
24
+ Each country code can have a regular expression named `area_code` that describes what the area code for that particular country looks like.
25
+
26
+ If an `area_code` regular expression isn't specified, the default, `Phoner::Phone::DEFAULT_AREA_CODE` (correct for the US) is used.
27
+
28
+ ### Validating
29
+
30
+ Validating is very relaxed, basically it strips out everything that's not a number or '+' character:
31
+
32
+ ```ruby
33
+ Phoner::Phone.valid? 'blabla 091/512-5486 blabla'
34
+ ```
35
+
36
+ ### Formatting
37
+
38
+ Formating is done via the `#format` method. The method accepts a `Symbol` or a `String`.
39
+
40
+ When given a string, it interpolates the string with the following fields:
41
+
42
+ * %c - country_code (385)
43
+ * %a - area_code (91)
44
+ * %A - area_code with leading zero (091)
45
+ * %n - number (5125486)
46
+ * %f - first @@n1_length characters of number (configured through Phoner::Phone.n1_length), default is 3 (512)
47
+ * %l - last characters of number (5486)
48
+ * %x - the extension number
49
+
50
+ ```ruby
51
+ pn = Phoner::Phone.parse('+385915125486')
52
+ pn.to_s # => "+385915125486"
53
+ pn.format("%A/%f-%l") # => "091/512-5486"
54
+ pn.format("+ %c (%a) %n") # => "+ 385 (91) 5125486"
55
+ ```
56
+
57
+ When given a symbol it is used as a lookup for the format in the <tt>Phoner::Phone.named_formats</tt> hash.
58
+
59
+ ```ruby
60
+ pn.format(:europe) # => "+385 (0) 91 512 5486"
61
+ pn.format(:us) # => "(234) 123 4567"
62
+ pn.format(:default_with_extension) # => "+3851234567x143"
63
+ ```
64
+
65
+ You can add your own custom named formats like so:
66
+
67
+ ```ruby
68
+ Phoner::Phone.named_formats[:short] = '%A/%n1-%n2'
69
+ pn.format(:short) # => 091/512-5486
70
+ ```
71
+
72
+ ### Finding countries by their isocode
73
+
74
+ If you don't have the country code, but you know from other sources what country a phone is from, you can retrieve the country using the country isocode (such as 'de', 'es', 'us', ...). Remember to call `Phoner::Country.load` before using this lookup.
75
+
76
+ ```ruby
77
+ if country = Phoner::Country.find_by_country_isocode(user_country_isocode)
78
+ phone_number = Phoner::Phone.parse(user_input, :country_code => country.country_code)
79
+ end
80
+ ```
81
+
82
+ ## Examples
83
+
84
+ ```ruby
85
+ require 'phone'
86
+ ```
87
+
88
+ ### Initializing
89
+
90
+ Initialize a new phone object with the number, area code, country code and extension number:
91
+
92
+ ```ruby
93
+ Phoner::Phone.new('5125486', '91', '385')
94
+ ```
95
+
96
+ ```ruby
97
+ Phoner::Phone.new(:number => '5125486', :area_code => '91', :country_code => '385', :extension => '143')
98
+ ```
99
+
100
+ ### Parsing
101
+
102
+ Create a new phone object by parsing from a string. Phoner::Phone does it's best to detect the country and area codes:
103
+
104
+ ```ruby
105
+ Phoner::Phone.parse '+385915125486'
106
+ Phoner::Phone.parse '00385915125486'
107
+ ```
108
+
109
+ If the country or area code isn't given in the string, you must set it, otherwise it doesn't work:
110
+
111
+ ```ruby
112
+ Phoner::Phone.parse '091/512-5486', :country_code => '385'
113
+ Phoner::Phone.parse '(091) 512 5486', :country_code => '385'
114
+ ```
115
+
116
+ If you feel that it's tedious, set the default country code once:
117
+
118
+ ```ruby
119
+ Phoner::Phone.default_country_code = '385'
120
+ Phoner::Phone.parse '091/512-5486'
121
+ Phoner::Phone.parse '(091) 512 5486'
122
+ ```
123
+
124
+ Same goes for the area code:
125
+
126
+ ```ruby
127
+ Phoner::Phone.parse '451-588', :country_code => '385', :area_code => '47'
128
+ ```
129
+ or
130
+
131
+ ```ruby
132
+ Phoner::Phone.default_country_code = '385'
133
+ Phoner::Phone.default_area_code = '47'
134
+
135
+ Phoner::Phone.parse '451-588'
136
+ ```
137
+
138
+ ## Test Countries
139
+
140
+ * [AU] Australia
141
+ * [BA] Bosnia and Herzegovina
142
+ * [BE] Belgium
143
+ * [DE] Germany
144
+ * [ES] Spain
145
+ * [FR] France
146
+ * [GB] United Kingdom
147
+ * [HR] Croatia
148
+ * [HU] Hungary
149
+ * [IE] Ireland
150
+ * [NL] Netherlands
151
+ * [NZ] New Zealand
152
+ * [RS] Serbia
153
+ * [SE] Sweden
154
+ * [SI] Slovenia
155
+ * [UA] Ukraine
156
+ * [US] United States
157
+ * [ZA] South Africa
158
+
159
+ ## Known issues
160
+
161
+ There's an issue with Germany and Spanish area codes.
162
+
163
+ ## Requirements
164
+
165
+
166
+ ## Install
167
+
168
+ $ gem install phone
169
+
170
+ Or as a Rails plugin
171
+
172
+ $ script/plugin install git://github.com/carr/phone.git
173
+
174
+ ## Copyright
175
+
176
+ Copyright (c) 2010-2013 Tomislav Car, [Infinum](http://www.infinumdigital.com)
177
+ Copyright (c) 2013 Don Morrison
178
+
179
+ See {file:LICENSE.txt} for details.
180
+
181
+ ## Contributors
182
+
183
+ Don Morrison, Michael Squires, Todd Eichel (Fooala, Inc.), chipiga, Etienne Samson, Luke Randall, Jakob Hilden, Tieg Zaharia
@@ -0,0 +1,38 @@
1
+ # encoding: utf-8
2
+
3
+ require "rubygems"
4
+
5
+ begin
6
+ require "bundler"
7
+ rescue LoadError => e
8
+ warn e.message
9
+ warn "Run `gem install bundler` to install Bundler."
10
+ exit -1
11
+ end
12
+
13
+ begin
14
+ Bundler.setup(:development)
15
+ rescue Bundler::BundlerError => e
16
+ warn e.message
17
+ warn "Run `bundle install` to install missing gems."
18
+ exit e.status_code
19
+ end
20
+
21
+ require "rake"
22
+
23
+ require "rubygems/tasks"
24
+ Gem::Tasks.new
25
+
26
+ require "rake/testtask"
27
+
28
+ Rake::TestTask.new do |test|
29
+ test.libs << "test"
30
+ test.pattern = "test/**/*_test.rb"
31
+ test.verbose = true
32
+ end
33
+
34
+ require "yard"
35
+ YARD::Rake::YardocTask.new
36
+ task :doc => :yard
37
+
38
+ task :default => :test
@@ -118,7 +118,7 @@
118
118
  :char_3_code: ZA
119
119
  :name: South Africa
120
120
  :international_dialing_prefix: "0"
121
- :area_code: "800|860|861|[1-5,7-8][0-9]"
121
+ :area_code: "800|86[01]|[1-57-8]\\d"
122
122
  "508":
123
123
  :country_code: "508"
124
124
  :national_dialing_prefix: "0"
@@ -357,7 +357,7 @@
357
357
  :char_3_code: UY
358
358
  :name: Uruguay
359
359
  :international_dialing_prefix: "0"
360
- :area_code: "2|42|43[34567]|4364|44[3457]|4452|4542|4544|456[7]?|4586|46[234]|4675|47[237]|4779|9[13456789]"
360
+ :area_code: "2|42|4364|43[34567]|4452|44[3457]|454[24]|4567?|4586|46[234]|4675|47[237]|4779|9[13456789]"
361
361
  "992":
362
362
  :country_code: "992"
363
363
  :national_dialing_prefix: "8"
@@ -372,7 +372,7 @@
372
372
  :char_3_code: NL
373
373
  :name: Netherlands
374
374
  :international_dialing_prefix: "0"
375
- :area_code: "6760|66|6|800|878|8[4578]|90[069]|1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7[0-9]|11[134578]|16[124-8]|17[24]|18[0-467]|22[2-46-9]|25[125]|29[479]|31[3-8]|32[01]|34[1-8]|41[12368]|47[58]|48[15-8]|49[23579]|5[129][1-9]|54[134-8]|56[126]|57[0-3578]"
375
+ :area_code: "6760|66|6|800|878|8[4578]|90[069]|1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7\\d|11[134578]|16[124-8]|17[24]|18[0-467]|22[2-46-9]|25[125]|29[479]|31[3-8]|32[01]|34[1-8]|41[12368]|47[58]|48[15-8]|49[23579]|5[129][1-9]|54[134-8]|56[126]|57[0-3578]"
376
376
  "850":
377
377
  :country_code: "850"
378
378
  :national_dialing_prefix: "0"
@@ -415,7 +415,7 @@
415
415
  :char_3_code: BE
416
416
  :name: Belgium
417
417
  :international_dialing_prefix: "0"
418
- :area_code: "800|90[0-9]|2|3|4|9|1[0-69]|5[0-9]|6[013-9]|7[01]|8[1-9]"
418
+ :area_code: "800|90\\d|2|3|4|9|1[0-69]|5\\d|6[013-9]|7[01]|8[1-9]"
419
419
  "965":
420
420
  :country_code: "965"
421
421
  :national_dialing_prefix: None
@@ -529,7 +529,7 @@
529
529
  :char_3_code: FR
530
530
  :name: France
531
531
  :international_dialing_prefix: "0"
532
- :area_code: "[1-7,8-9]"
532
+ :area_code: "[1-9]"
533
533
  "995":
534
534
  :country_code: "995"
535
535
  :national_dialing_prefix: 8*
@@ -572,7 +572,7 @@
572
572
  :char_3_code: ES
573
573
  :name: Spain
574
574
  :international_dialing_prefix: "0"
575
- :area_code: "6[0-9][0-9]|7[1-9][0-9]|9[0-9][0-9]"
575
+ :area_code: "6[0-9][0-9]|7[1-9][0-9]|9[0-9][0-9]"
576
576
  "232":
577
577
  :country_code: "232"
578
578
  :national_dialing_prefix: "0"
@@ -636,6 +636,7 @@
636
636
  :char_3_code: NZ
637
637
  :name: New Zealand
638
638
  :international_dialing_prefix: "0"
639
+ :area_code: "[1-9]"
639
640
  "855":
640
641
  :country_code: "855"
641
642
  :national_dialing_prefix: "0"
@@ -748,7 +749,7 @@
748
749
  :char_3_code: HU
749
750
  :name: Hungary
750
751
  :international_dialing_prefix: "0"
751
- :area_code: "1|[2-9][0-9]"
752
+ :area_code: "1|[2-9]\\d"
752
753
  "263":
753
754
  :country_code: "263"
754
755
  :national_dialing_prefix: "0"
@@ -959,7 +960,7 @@
959
960
  :char_3_code: PT
960
961
  :name: Portugal
961
962
  :international_dialing_prefix: "0"
962
- :area_code: "21|22|2[3-9][1-9]|70[78]|80[089]|9[136]|92[1-9]"
963
+ :area_code: "2[12]|2[3-9][1-9]|70[78]|80[089]|9[136]|92[1-9]"
963
964
  "973":
964
965
  :country_code: "973"
965
966
  :national_dialing_prefix: None
@@ -974,7 +975,7 @@
974
975
  :char_3_code: UA
975
976
  :name: Ukraine
976
977
  :international_dialing_prefix: "00"
977
- :area_code: "[1-9][0-9]"
978
+ :area_code: "[1-9]\\d"
978
979
  "41":
979
980
  :country_code: "41"
980
981
  :national_dialing_prefix: "0"
@@ -1024,7 +1025,7 @@
1024
1025
  :char_3_code: RS
1025
1026
  :name: Serbia
1026
1027
  :international_dialing_prefix: "99"
1027
- :area_code: "[1-9][0-9]"
1028
+ :area_code: "[1-9]\\d"
1028
1029
  "975":
1029
1030
  :country_code: "975"
1030
1031
  :national_dialing_prefix: None
@@ -1046,6 +1047,7 @@
1046
1047
  :char_3_code: IE
1047
1048
  :name: Ireland
1048
1049
  :international_dialing_prefix: "0"
1050
+ :area_code: "1|[2,4-7,9][0-9]|8[0,3-9]|822|818"
1049
1051
  "692":
1050
1052
  :country_code: "692"
1051
1053
  :national_dialing_prefix: "1"
@@ -1173,7 +1175,7 @@
1173
1175
  :char_3_code: HR
1174
1176
  :name: Croatia
1175
1177
  :international_dialing_prefix: "0"
1176
- :area_code: "1|[2-9][0-9]"
1178
+ :area_code: "1|[2-9]\\d"
1177
1179
  "243":
1178
1180
  :country_code: "243"
1179
1181
  :national_dialing_prefix: None
@@ -1195,7 +1197,7 @@
1195
1197
  :char_3_code: SE
1196
1198
  :name: Sweden
1197
1199
  :international_dialing_prefix: "0"
1198
- :area_code: "900|1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|7[01236]|8|9[09]|1[2457][0-9]|2[2457-9][0-9]|3[0247-9][0-9]|4[1357-9][0-9]|5[0-35-9][0-9]|6[124-9][0-9]|74[0-9]|9[1-8][0-9]"
1200
+ :area_code: "900|1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|7[01236]|8|9[09]|1[2457]\\d|2[2457-9]\\d|3[0247-9]\\d|4[1357-9]\\d|5[0-35-9]\\d|6[124-9]\\d|74\\d|9[1-8]\\d"
1199
1201
  "386":
1200
1202
  :country_code: "386"
1201
1203
  :national_dialing_prefix: "0"
@@ -1203,7 +1205,7 @@
1203
1205
  :char_3_code: SI
1204
1206
  :name: Slovenia
1205
1207
  :international_dialing_prefix: "0"
1206
- :area_code: "30|40|31|41|51|71|70|64|59|1|2|3|4|5|6|7"
1208
+ :area_code: "3[01]|4[01]|51|7[01]|64|59|1|2|3|4|5|6|7"
1207
1209
  "358":
1208
1210
  :country_code: "358"
1209
1211
  :national_dialing_prefix: "0"
@@ -1239,7 +1241,7 @@
1239
1241
  :char_3_code: BA
1240
1242
  :name: Bosnia and Herzegovina
1241
1243
  :international_dialing_prefix: "0"
1242
- :area_code: "[0-9][0-9]"
1244
+ :area_code: "6|[0-57-9]\\d"
1243
1245
  "245":
1244
1246
  :country_code: "245"
1245
1247
  :national_dialing_prefix: None