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: [email protected] 
[mailto:[email protected]] On Behalf Of Chris Green
Sent: Monday, June 20, 2011 12:39 PM
To: [email protected]
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








_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to