From: doug <dro...@al...> - 2010-04-10 07:56:09
|
On 05/04/10 16:00, doug wrote: > On 05/04/10 15:50, Doug wrote: >> On 05/04/10 14:04, joel robin wrote: >>> Doug, >>> >>> 1) Yes the places are in the same format. >>> If informations are missing, there is an empty field >>> (Woerth,,,Alsace,FRANCE,) >>> >>> 2)What you said: >>> Avignon to City >>> 84000 to ZIP >>> Vaucluse to County >>> Province-Cote-d'Azur to State (taking State to be simply a larger >>> administrative unit) >>> France to Country >>> >>> seems to be ok. >>> >>> So, let's try to do it ;) >>> >>> Regards, >>> Joël >>> >>> >>> >>> >> To summarise for the list: \s*(?P<city>[^,]+)[,]\s*(?P<zip>\d*)[,](?P<county>[^,]*)[,](?P<state>[^,]*)[,](?P<country>[^,]*)[,]*$ parses the French placenames It allows for some initial whitespace and for missing fields, so long as they are delimited by commas, It expects that the first field (City) is never empty. Doug |