
Attached patch does the trick easier: mkgmap:country=DEU& mkgmap:city!=* { set mkgmap:city='${mkgmap:admin_level8|remove:Gemeinde !Stadt }' } The filter "remove" removes all occurrences of the defined regexp. Regexps are separated by "!". Please have a try. Maybe someone has a better idea for the separator character? WanMil
On Tue, Dec 06, toc-rox wrote:
How is it possible to substitute more than one word ?
I have something like this as names in "admin_level=8": "Gemeinde Spalt" "Gemeinde Maxdorf" "Stadt Linz am Rhein" "Stadt Rodgau"
I want to replace "Gemeinde " and "Stadt " with nothing. How is it possible to combine: mkgmap:country=DEU& mkgmap:city!=*& mkgmap:admin_level8=* { set mkgmap:city='${mkgmap:admin_level8|subst:Gemeinde }' } and mkgmap:country=DEU& mkgmap:city!=*& mkgmap:admin_level8=* { set mkgmap:city='${mkgmap:admin_level8|subst:Stadt }' }
I only know a way how to do it with three (untested yet):
mkgmap:country=DEU& mkgmap:city!=*& mkgmap:admin_level8~'Gemeinde.*' { set mkgmap:city='${mkgmap:admin_level8|subst:Gemeinde }' } mkgmap:country=DEU& mkgmap:city!=*& mkgmap:admin_level8~'Stadt.*' { set mkgmap:city='${mkgmap:admin_level8|subst:Stadt }' } mkgmap:country=DEU& mkgmap:city!=*& mkgmap:admin_level8=* { set mkgmap:city='${mkgmap:admin_level8|subst:Gemeinde }' }
which will create a huge amount of additional rules ...
Thorsten