mirror of
https://github.com/Respect/Validation.git
synced 2024-06-08 16:52:16 +02:00
Update validation for Israeli postal codes
According to Wikipedia [1]: > Until February 2013, Israel postal codes were 5-digit. Officially the > 5-digit codes remained valid until 31 January 2013, though they > continue to be widely used. This commit changes the "PostalCode" rule to allow either 5 or 7 digits. [1]: https://en.wikipedia.org/wiki/List_of_postal_codes Co-authored-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
3501192293
commit
b7b67da31e
|
@ -89,7 +89,7 @@ final class PostalCode extends AbstractEnvelope
|
|||
'HU' => '/^(\d{4})$/',
|
||||
'ID' => '/^(\d{5})$/',
|
||||
'IE' => '/^([AC-FHKNPRTV-Y][0-9]{2}|D6W) ?[0-9AC-FHKNPRTV-Y]{4}$/',
|
||||
'IL' => '/^(\d{5})$/',
|
||||
'IL' => '/^(\d{5}|\d{7})$/',
|
||||
'IM' => '/^((?:(?:[A-PR-UWYZ][A-HK-Y]\d[ABEHMNPRV-Y0-9]|[A-PR-UWYZ]\d[A-HJKPS-UW0-9])\s\d[ABD-HJLNP-UW-Z]{2})|GIR\s?0AA)$/',
|
||||
'IN' => '/^(\d{6})$/',
|
||||
'IQ' => '/^(\d{5})$/',
|
||||
|
|
|
@ -81,6 +81,8 @@ final class PostalCodeTest extends RuleTestCase
|
|||
[new PostalCode('IE'), 'D14 YD91'],
|
||||
[new PostalCode('IE'), 'D6W 3333'],
|
||||
[new PostalCode('EC'), '170515'],
|
||||
[new PostalCode('IL'), '7019900'],
|
||||
[new PostalCode('IL'), '94142'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue