Problem with regular expression and subst: filter

I want to add the following rule to my "Latin languages manage system": highway=* & name ~ "(?i)Chemin\s+d['’´]+acc[èe]s\s+[àa]\s+la\s+.*" { add streettype:movedend="${name|subst:(?i)Chemin\s+d['’´]+acc[èe]s\s+[àa]\s+la\s+~>}, Chemin d'accès"} It catches "Chemin D'Accès à la Piscine" and "Chemin D'Accès A la Piscine", but not "Chemin D'Accès À la Piscine" (note the difference in à, A or À) If I use rule highway=* & name ~ "(?i)Chemin\s+d['’´]+acc[èe]s\s+À\s+la\s+.*" { add streettype:movedend="${name|subst:(?i)Chemin\s+d['’´]+acc[èe]s\s+À\s+la\s+~>}, Chemin d'accès"} then the third form is caught, but obviously the other ones not. Any idea why first rule is not working for all forms?

Hi Carlos, did not try it, but the docu says for (?i) " By default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching can be enabled by specifying the UNICODE_CASE flag in conjunction with this flag." This would be (?u). See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#CASE_... Does that help? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Freitag, 7. April 2017 16:26:09 An: Development list for mkgmap Betreff: [mkgmap-dev] Problem with regular expression and subst: filter I want to add the following rule to my "Latin languages manage system": highway=* & name ~ "(?i)Chemin\s+d['’´]+acc[èe]s\s+[àa]\s+la\s+.*" { add streettype:movedend="${name|subst:(?i)Chemin\s+d['’´]+acc[èe]s\s+[àa]\s+la\s+~>}, Chemin d'accès"} It catches "Chemin D'Accès à la Piscine" and "Chemin D'Accès A la Piscine", but not "Chemin D'Accès À la Piscine" (note the difference in à, A or À) If I use rule highway=* & name ~ "(?i)Chemin\s+d['’´]+acc[èe]s\s+À\s+la\s+.*" { add streettype:movedend="${name|subst:(?i)Chemin\s+d['’´]+acc[èe]s\s+À\s+la\s+~>}, Chemin d'accès"} then the third form is caught, but obviously the other ones not. Any idea why first rule is not working for all forms? _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Thanks for the info. (?i)(?u) did the trick. El 07/04/17 a las 16:35, Gerd Petermann escribió:
Hi Carlos,
did not try it, but the docu says for (?i) " By default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching can be enabled by specifying the UNICODE_CASE flag in conjunction with this flag." This would be (?u).
See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#CASE_...
Does that help? Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Carlos Dávila <cdavilam@orangecorreo.es> Gesendet: Freitag, 7. April 2017 16:26:09 An: Development list for mkgmap Betreff: [mkgmap-dev] Problem with regular expression and subst: filter
I want to add the following rule to my "Latin languages manage system": highway=* & name ~ "(?i)Chemin\s+d['’´]+acc[èe]s\s+[àa]\s+la\s+.*" { add streettype:movedend="${name|subst:(?i)Chemin\s+d['’´]+acc[èe]s\s+[àa]\s+la\s+~>}, Chemin d'accès"} It catches "Chemin D'Accès à la Piscine" and "Chemin D'Accès A la Piscine", but not "Chemin D'Accès À la Piscine" (note the difference in à, A or À) If I use rule highway=* & name ~ "(?i)Chemin\s+d['’´]+acc[èe]s\s+À\s+la\s+.*" { add streettype:movedend="${name|subst:(?i)Chemin\s+d['’´]+acc[èe]s\s+À\s+la\s+~>}, Chemin d'accès"} then the third form is caught, but obviously the other ones not. Any idea why first rule is not working for all forms?
participants (2)
-
Carlos Dávila
-
Gerd Petermann