[Tagging] Wiki Edit War on using/avoiding semicolon lists

jgpacker john.packer7 at gmail.com
Wed Jan 21 14:37:38 UTC 2015


    Better try to query for "13" in ref="3;10;13;113;133" without loosing
your sanity.
    Next day I will add ref="3;10;13;113;133;13E" — will you update your
query?

I believe the following regular expression is enough for both examples:
    ref ~ "\b13\b"

\b means word boundary (any character that starts or ends a word, such as
space, colon, semicolon, etc)

However, word boundaries can be slow and are not recommended if you need to
search large areas (e.g. whole world, germany or similar).
In this case, we could use something like:

    ref ~ "(;|^)13(;|$)" 

which can be read as: either semicolon or the start of the value, followed
by 13, followed by either semicolon or the end of the value.
I would recommend to also allow a space before 13 (because people sometimes
like to add an extra space after the semicolon), making it:

    ref ~ "(;|^| )13(;|$)" 


Note: For technical reasons, if you need to use a word boundary in Overpass
QL, use \\b (you need to escape the backslash character). This is not the
case in Overpass XML.

PS: I don't know Perl and don't want to learn it. Regular expression is a
common feature in mature programming languages.



--
View this message in context: http://gis.19327.n5.nabble.com/Wiki-Edit-War-on-using-avoiding-semicolon-lists-tp5830523p5830838.html
Sent from the Tagging mailing list archive at Nabble.com.



More information about the Tagging mailing list