Update Serbian postal code validation

According to Wikipedia, also known as the most reliable source of
information on the whole Internet, Serbian postal codes consist of five
digits [1].

Even though it mentions that a six-digit postal code format has been in
place since 1 January 2005 [2], I have not found any Serbian postal code
which consists of six digits.

Maybe someone would prove us wrong, but we will keep the validation as
six-digits from now one.

[1]: https://en.wikipedia.org/wiki/Postal_codes_in_Serbia
[2]: https://web.archive.org/web/20090917083620/http://www.posta.rs/postanskamreza/postanskamreza.asp

Co-authored-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
Daniel Altenburg 2020-07-14 20:51:45 +02:00 committed by Henrique Moody
parent e2783d4220
commit 0a3f4c6a4b
No known key found for this signature in database
GPG key ID: 221E9281655813A6
2 changed files with 3 additions and 1 deletions

View file

@ -156,7 +156,7 @@ final class PostalCode extends AbstractEnvelope
'PY' => '/^(\d{4})$/',
'RE' => '/^((97|98)(4|7|8)\d{2})$/',
'RO' => '/^(\d{6})$/',
'RS' => '/^(\d{6})$/',
'RS' => '/^(\d{5})$/',
'RU' => '/^(\d{6})$/',
'SA' => '/^(\d{5})$/',
'SD' => '/^(\d{5})$/',

View file

@ -88,6 +88,7 @@ final class PostalCodeTest extends RuleTestCase
[new PostalCode('KY'), 'KY2-2001'],
[new PostalCode('KY'), 'KY3-2500'],
[new PostalCode('AM'), '0010'],
[new PostalCode('RS'), '24430'],
];
}
@ -111,6 +112,7 @@ final class PostalCodeTest extends RuleTestCase
[new PostalCode('EC'), 'A1234B'],
[new PostalCode('KY'), 'KY4-2500'],
[new PostalCode('AM'), '375010'],
[new PostalCode('RS'), '244300'],
];
}
}