[mapserver-users] RegEx bug php mapscript

Christopher Thorne geothorne at gmail.com
Tue Jul 22 13:42:14 EDT 2008


Hello all,
I found a tricky bug related to RegEx in php mapscript (5.1 build 2600 
from MS4W) and 5.1 perl mapscript. In case this is not know.

When creating a class with an expression I created a typo that created 
two different responses between php mapscript vs. perl mapscript.

Here is the case.

Wrong (with typo see first | after /) :
------

CLASS #1
	NAME "Below $500 SF"
	EXPRESSION /|^[1-4][0-9][0-9]$|^[1-9][0-9]$|^[1-9]$/
...

Correct:
-------
CLASS #1
	NAME "Below $500 SF"
	EXPRESSION /^[1-4][0-9][0-9]$|^[1-9][0-9]$|^[1-9]$/

RESULTS
=======
In php_mapscript:

It ignored the | or treated it as a character, which allowed the 
statement to work the way I wanted it to. (without the |)

In perl mapscript:

Had the correct response collecting all values in to the single class. 
Allowing me to see my typo.

Regards,
Chris

-- 
Geomatics (GIS) Specialist,
Christopher R. Thorne,
geothorne at gmail.com
-----------------------------


More information about the mapserver-users mailing list