Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.

- Drop support for end-of-life Ruby (< 3.3) and Rails (< 8.0); test on Ruby 3.3, 3.4 and 4.0 with Rails 8.0, 8.1 and main
- Replace the defunct Travis CI setup with GitHub Actions
- Accept Nigeria's (NG) 11-character digital postcode, such as `EK-01-A03-FK-01`, alongside the six-digit code. NIPOST launched it in October 2026. Thanks to ~ @Adeniyikayodee
- Fix the Moldova (MD) postcode pattern: accept the canonical `MD-####` form and bare 4-digit codes, and reject non-`MD` letter prefixes. The previous pattern required any two letters and rejected the hyphenated form — fixes #73

## 0.6.0
Expand Down
2 changes: 1 addition & 1 deletion lib/validates_zipcode/cldr_regex_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module CldrRegexpCollection
MA: /\A\d{5}\z/,
NZ: /\A\d{4}\z/,
NI: /\A\d{5}\z/,
NG: /\A\d{6}\z/,
NG: /\A(\d{6}|[A-Z]{2}[- ]?(0[1-9]|[1-9]\d)[- ]?[A-Z0-9]{3}[- ]?[A-Z]{2}[- ]?(0[1-9]|[1-9]\d))\z/i,
OM: /\A(PC )?\d{3}\z/i,
PK: /\A\d{5}\z/,
PY: /\A(\d{4}|\d{6})\z/,
Expand Down
19 changes: 13 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1065,19 +1065,26 @@
]
},
NG: {
valid: %w[
071134
025663
662612
071135
valid: [
'071134',
'025663',
'662612',
'071135',
'EK-01-A03-FK-01',
'EK 01 A03 FK 01',
'EK01A03FK01',
'ek01a03fk01'
],
invalid: [
nil,
'',
'invalid_zip',
'12345',
'123456-123456',
'D0D0D0'
'D0D0D0',
'EK-00-A03-FK-01',
'EK-01-A03-FK-00',
'EK-01-A03-FK-011'
]
},
OM: {
Expand Down
Loading