Serbian Postal Codes Use 6 Digit Regex Validation when should use 5
Hey, Me again, your postal code friend.
My Serbians are reporting issues with our Postal Code Validator. According to them, (and this wiki https://en.wikipedia.org/wiki/Postal_codes_in_Serbia), their postal code should consist of 5 Digits. We validate against 6.
PR incoming.
PR submitted to earliest stable release 0.9. https://github.com/Respect/Validation/pull/1305
As the Wikipedia article states:
A six-digit postcode format has been in place since 1 January 2005
Since no transition period was defined and the 5-digit format is still rather common, the 6-digit format is not "invalid" and validation should pass both formats.
I suggest you replace the Regex by "/^(\d{5,6})$/" to cover both occurences.
This has been fixed on branch 2.3. It will be available on the next release.
Excellent, thanks a lot!
Version 2.3 is available! If that doesn't work as expected, let us know! Thank you for reporting! 🐼