feat: add postcode patterns for Colombia (CO) and British Virgin Islands (VG)#1547
Merged
zemzale merged 1 commit intogo-playground:masterfrom Mar 24, 2026
Merged
Conversation
…nds (VG)
- CO: 6-digit format used by Código Postal Colombiano (^\d{6}$)
- VG: BVI postcode format introduced by the BVI Postal Service (^VG\d{4}$)
Both country codes are present in iso3166_1_alpha2 but were missing
from postCodePatternDict, causing postcode_iso3166_alpha2 validation
to unconditionally fail for these countries.
zemzale
approved these changes
Mar 24, 2026
Member
zemzale
left a comment
There was a problem hiding this comment.
After a quick google search, seems correct.
bfabio
pushed a commit
to bfabio/validator
that referenced
this pull request
Apr 8, 2026
…nds (VG) (go-playground#1547) ## Summary Two ISO 3166-1 alpha-2 country codes are present in `iso3166_1_alpha2` (i.e., valid countries) but missing from `postCodePatternDict`, causing `postcode_iso3166_alpha2` and `postcode_iso3166_alpha2_field` validators to unconditionally return `false` for these countries. This PR adds the missing patterns: | Country | Code | Pattern | Example | |---------|------|---------|---------| | Colombia | `CO` | `^\d{6}$` | `110111` | | British Virgin Islands | `VG` | `^VG\d{4}$` | `VG1110` | ### References - Colombia postal code system (Código Postal Colombiano): 6-digit numeric format - BVI postal code system introduced by the BVI Postal Service: `VG` prefix followed by 4 digits (e.g. `VG1110`, `VG1120`) ## Test plan - All existing tests pass (`go test ./...`) - Both patterns follow the same conventions as surrounding entries in `postcode_regexes.go`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two ISO 3166-1 alpha-2 country codes are present in
iso3166_1_alpha2(i.e., valid countries) but missing frompostCodePatternDict, causingpostcode_iso3166_alpha2andpostcode_iso3166_alpha2_fieldvalidators to unconditionally returnfalsefor these countries.This PR adds the missing patterns:
CO^\d{6}$110111VG^VG\d{4}$VG1110References
VGprefix followed by 4 digits (e.g.VG1110,VG1120)Test plan
go test ./...)postcode_regexes.go