pelias / parser

natural language classification engine for geocoding
https://parser.demo.geocode.earth
MIT License
55 stars 27 forks source link

Recognise 6-position postcodes in addresses in the Netherlands (with spaces) #134

Open emacgillavry opened 3 years ago

emacgillavry commented 3 years ago

Typically, addresses in the Netherlands have 4 digits, followed by 0 or 1 space, followed by 2 alphanumeric characters, e.g. "7512EC" or "7512 EC". The alphanumeric characters should not be "SA", "SD" or "SS":

/^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i;

This bug is to track the latter case, i.e. "7512 EC".

emacgillavry commented 3 years ago

Regex works properly. However, it's further upstream the space in between breaks the postal code into 2 sections. Also happens for UK postcodes.