<div class="gmail_quote">On Sun, Dec 6, 2009 at 6:21 PM, David Calder <span dir="ltr"><<a href="mailto:davidjcalder@gmail.com">davidjcalder@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>I was wondering if you could help me. I'm using Tagwatch to find and tidy up the route_ref=* values where a pipe symbol or vbar (i.e. Unicode character U+007C) has been used as a delimeter. See this page for example: <a href="http://tagwatch.stoecker.eu/Great_britain/En/ignored_route_ref.html" target="_blank">http://tagwatch.stoecker.eu/Great_britain/En/ignored_route_ref.html</a><br>

<br>The query for a semicolon delimited value is (for example):<br><a href="http://tagwatch.stoecker.eu/osmxapi/*%5Broute_ref=171;172;178%5D" target="_blank">http://tagwatch.stoecker.eu/osmxapi/*[route_ref=171;172;178]</a><br>
which works fine.<br>
<br>However, the query for a pipe delimited value is (for example):<br><a href="http://tagwatch.stoecker.eu/osmxapi/*%5Broute_ref=46%7C46A%5D" target="_blank">http://tagwatch.stoecker.eu/osmxapi/*[route_ref=46|46A]</a><br>
which returns the data for values that match 46 OR 46A but not "46|46A". I know that this is the correct functionality as defined in the API spec but how do I write the query so that it finds "46|46A". Do I need to escape the character (and if so, how?) or do I need to encode it somehow (and if so, how?)<br>
</blockquote><div><br>I've just added escaping for this this and other characters.  To treat | as a literal value escape it as \| so your query would be:<br><br><a href="http://tagwatch.stoecker.eu/osmxapi/*[route_ref=46">http://tagwatch.stoecker.eu/osmxapi/*[route_ref=46</a>\|46A]<br>
<br>You can escape other characters [ ] = / etc in the same way.<br><br>Spaces normally don't need to be escaped but this depends to some extent on the client you are using.  If you do need to escape space then it's URL encoding that you need, so use %20 in place of a space.<br>
<br>80n<br><br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Many thanks,<br><font color="#888888">David<br><br><br>
</font><br>_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/listinfo/dev" target="_blank">http://lists.openstreetmap.org/listinfo/dev</a><br>
<br></blockquote></div><br>