tyrasd / overpass-turbo

A web based data mining tool for OpenStreetMap using the Overpass API.
https://overpass-turbo.eu
Other
948 stars 135 forks source link

Regex not working for for addr:housenumber #648

Closed gdprdatasubect closed 1 year ago

gdprdatasubect commented 1 year ago

Hello,

i tried finding large housenumbers, but the following did not work:

  node["addr:housenumber"~"^\d{4}"]({{bbox}});
  way["addr:housenumber"~"^\d{4}"]({{bbox}});

Am i missing something or using it wrong?

mmd-osm commented 1 year ago

You're missing a second "\", as documented here: https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Value_matches_regular_expression_(~,_!~)

Please note that in QL you need to escape backslashes: ...

Anyway, you probably want to do something like the following instead.

nw["addr:housenumber"~"^[0-9]{4}$"]({{bbox}});
out center;

Also, please head to https://community.osm.org next time, since your question has nothing to do with the overpass turbo website code.

gdprdatasubect commented 1 year ago

I thought it was an issue on the website and not my own stupidity, sorry