queryByAttributes qstring expression and Oracle

Andreas Albarello andreas.albarello at TERRITORIUMONLINE.COM
Wed Nov 7 02:16:08 PST 2007


Gambin Dejan wrote:
> I have to use queryByAttributes to make an external database jointo 
> Oracle database. It works perfectly except when it needs to match an 
> expression that includes a slash character („/“), like:
> 
> "[NAME]" =~ /214/2/
> 
> where the string „214/2“ is the value it has to find. If I put "[NAME]" 
> =~ /214/, it finds it, but my users will often use „214/2“ in their 
> query. I hav tried escaping the slash sign, like:
> 
> "[NAME]" =~ /214\/2/
> 
> but it still doesn't find the value. If I put "[NAME]" =~ /214.2/  then 
> the value is found.

Dejan,

there is currently no way to escape a slash inside a regular expression 
in MapServer. In addition, I don't think GNU regex supports any kind of 
octal or hex notation to specify a certain character like

/214\x2f2/

where \x2f would be the slash character (ASCII #47 = 2f).

Only thing that comes to mind would be to link MapServer against the PHP 
PCRE regex, if that still works (haven't tried it in a while). 
Perl-compatible regular expressions should then allow you to do the sort 
of hex-escape I mentioned above.

Best regards,
-- 
--------------------------------------------------------------------
Andreas Albarello
Analysis & SW Development

Territorium Online srl/GmbH
Via Buozzi/Buozzistraße 12 - I 39100 Bolzano/Bozen
email: andreas.albarello at territoriumonline.com
web:   www.territoriumonline.com
--------------------------------------------------------------------



More information about the MapServer-users mailing list