Itemquery and RegEx

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Sep 13 15:44:21 EDT 2004


This one blows up for a couple of reasons:

1) regular expressions are to be enclosed in //'s
2) the syntax is wrong, the ()'s are tricking the expression parser
into treating (W|w) as a logical expression, a malformed logical
expression at that (hence the parse errors)

Try qstring=/[Ww]ashington/ and see if that works.

Steve

>>> Daniele Margotti <margottid at COMUNE.LUGO.RA.IT> 9/9/2004 5:04:08 AM
>>>
Hi list,
when I use "mode=itemnquery" (or "mode=itemquery") and I put a regular
expression as search string (for example, "qstring=(W|w)ashington") I
get
this error:

msQueryByAttributes(): Search returned no results. No matching
record(s)
found.
msyyparse(): Expression parser error. parse error
msyyparse(): Expression parser error. parse error
msyyparse(): Expression parser error. parse error
msyyparse(): Expression parser error. parse error
msyyparse(): Expression parser error. parse error
...
...

A "normal" search string (e.g., "qstring=Washington") works well:
record
is found, and query result is shown.

I use MapServer as CGI.

This is 'mapserv -v' output:

MapServer version 4.0.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_CLIENT INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=OGR
INPUT=GDAL
INPUT=SHAPEFILE

What's wrong?

 Daniele


P.S.: why can't I send messages through my e-mail client? I have to
use
the web interface...



More information about the mapserver-users mailing list