Fix: Validate Austrian post codes to exclude invalid values starting with 0 by weswaldix · Pull Request #15 · brick/postcode

Skip to content

Navigation Menu

Sign in

Appearance settings

Conversation

@weswaldix

Previously, postal codes such as '0000' or '0999' were considered valid, but in reality, Austrian postal codes always start with digits from 1 to 9. This update corrects the validation to ensure compliance with the Austrian postal code system
(see: https://en.wikipedia.org/wiki/Postal_codes_in_Austria#System).

…g with 0

Previously, postal codes such as '0000' or '0999' were considered valid, but in reality, Austrian postal codes always start with digits from 1 to 9. This update corrects the validation to ensure compliance with the Austrian postal code system (see: https://en.wikipedia.org/wiki/Postal_codes_in_Austria#System).

@BenMorel

Thank you, can you please add a note about this in the docblock?

Postcodes consist of 4 digits, without separator.

Postcodes consist of 4 digits, without separator. The first digit must be 1-9.

@weswaldix

Done so - I hope that's ok (I don't work with GitHub Pull Requests usualy) ^^

@BenMorel

@BenMorel

2 participants

@weswaldix @BenMorel