diff --git a/CHANGELOG.md b/CHANGELOG.md index 578c2a36..a70dab4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + +- Virgin Islands' postal code validation + ## [4.28.0] - 2025-12-09 ### Added diff --git a/react/country/VIR.js b/react/country/VIR.js index 672e1a60..f19a6412 100644 --- a/react/country/VIR.js +++ b/react/country/VIR.js @@ -18,8 +18,8 @@ export default { fixedLabel: 'ZIP', required: true, mask: '99999-9999', - regex: '^008(01|02|03|04|05|20|21|22|23|24|30|31|40|41|50|51)-\d{0,4}$', - // Asserts zipcode starts with 008, then contains one of the local accepted area values, then followed by hyphen and 4 digits. + regex: '^008(01|02|03|04|05|20|21|22|23|24|30|31|40|41|50|51)(-\d{4})?$', + // Asserts zipcode starts with 008, then contains one of the local accepted area values, optionally followed by hyphen and exactly 4 digits. postalCodeAPI: true, forgottenURL: 'https://tools.usps.com/go/ZipLookupAction!input.action', size: 'small',