[mapserver-users] Mapserver 6.0 regex

Lime, Steve D (DNR) steve.lime at state.mn.us
Tue Jun 21 12:09:09 EDT 2011


Hmmm... A plain 'ol regex expression did not change between 5.6 and 6.0, so this is still valid:

  FILTERITEM 'myitem'
  FILTER /myregex/

Where regex's changed is inside logical expressions:

  FILTER ('[myitem]' ~= /myregex/) becomes FILTER ('[myitem]' ~ 'myregex')

There are regression tests for these cases (query/filters.map) so I'm pretty sure MapServer proper is working ok. You might try setting the filter and filteritem directly in the mapfile see if that works. If it does then it's likely a problem with PHP/MapScript.

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Chris Green
Sent: Monday, June 20, 2011 12:39 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Mapserver 6.0 regex

I have one (hopefully the last!) problem with migrating from Mapserver 4.6 to 6.0, this time over the use of regex.

Using Mapscript  on a Fedora platform I have been setting a filter in this manner:


$map=newMapobj("/var/www/vhosts/mysite/httpdocs/test.map");
$layer1=$map->getLayerByName("test1");
$layer1->set("filteritem", "Attribute1");
$layer1->setFilter("/target/");

This worked fine, but not anymore.  I see in the migration guide that a regex should now be delineated as a string so I assume that "/target/" should become "target". But that doesn't work either.


I am wondering if part of the problem is that as well as going from Mapserver 4.6 to 5.0 I also changed from Fedora to Ubuntu 10.04, and I see from the Mapserver documentation on Expressions that the OS may affect regex operation.

Am I missing something obvious here?   I am really tired of going in circles over this...


Chris








-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110621/7b7bc977/attachment-0001.html


More information about the mapserver-users mailing list