You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nicaragua uses the ISO 3166-2 country code NI. The current regex for Nicaraguan postal codes is hosted on this GitHub repository:
/^((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?$/
This pattern successfully validates:
An empty string → Entire pattern is optional.
123-456 → Core 3-3 pattern.
1234-123-456 → Optional 4-digit prefix.
123-456-7 → Optional single-digit suffix.
1234-123-456-7 → Includes all optional parts.
However, according to codigo-postal.org and en.youbianku.com, Nicaraguan postal codes consist of 5 digits and never start with 0. grcdi.nl outlines the following specific number ranges for postal codes:
Thanks for researching Nicaraguan postcodes. Can you optimise your regex for the first two digits as I see the first digit can be 1-9 and the second digit 1-8?
Also, please raise a PR. 🙏
Nicaragua uses the ISO 3166-2 country code
NI
. The current regex for Nicaraguan postal codes is hosted on this GitHub repository:This pattern successfully validates:
123-456
→ Core 3-3 pattern.1234-123-456
→ Optional 4-digit prefix.123-456-7
→ Optional single-digit suffix.1234-123-456-7
→ Includes all optional parts.However, according to codigo-postal.org and en.youbianku.com, Nicaraguan postal codes consist of 5 digits and never start with 0. grcdi.nl outlines the following specific number ranges for postal codes:
And suggests this regex:
I recommend updating the Nicaraguan postal code regex for more accurate validation.
The text was updated successfully, but these errors were encountered: