Re: [mapserver-users] Problems when using complex expressions
Thanks, Andreas, I've tried your solution (and already looked over the manual) but it still doesn't match anything... Also - EXPRESSION ([myColumn] =~ /MYREGEXP/i) doesn't match anything and EXPRESSION [myColumn] =~ /MYREGEXP/i complains of a syntax error. myColumn is the exact same thing as what I use in the layer's CLASSITEM definition. I am puzzled... I think I'm using the EXPRESSION syntax the wrong way, but I'm not sure what I'm doing wrong. Regards, Adrian Andreas Albarello wrote: Adrian Popa wrote: EXPRESSION (/MYREGEXP/i)- doesn't work (doesn't match anything) EXPRESSION /MYREGEXP/i - works EXPRESSION [myColumn] ==1 - doesn't work (loadClass(): Unknown identifier. Parsing error near (=)) EXPRESSION ([myColumn] ==1) - doesn't work (doesn't match anything) EXPRESSION ([myColumn] eq 1) - works EXPRESSION (/MYREGEXP/i) ([myColumn] eq 1) - doesn't work (doesn't match anything) EXPRESSION /MYREGEXP/i ([myColumn] eq 1) - doesn't work (loadClass(): Unknown identifier. Parsing error near ()) EXPRESSION ((/MYREGEXP/i) ([myColumn] eq 1)) - doesn't work (doesn't match anything) I have checked my data and it should match - most likely, my expression is wrong. Any suggestions? What is the correct syntax for mixing regular expressions with other values? Adrian, have a look at this: http://mapserver.org/mapfile/expressions.html As far as mixing regular and other expressions goes, this is the correct way to do it: EXPRESSION (([myColumn] =~ /MYREGEXP/i) ([myColumn] eq 1)) Best regards, ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Problems when using complex expressions
I managed to find a workaround for my problem: I used a FILTER statement in the layer definition and an EXPRESSION in my classes: LAYER ... FILTERITEM myColumn1 FILTER /MYREGEXP/i CLASS NAME Test EXPRESSION ( [myColumn2] eq 1 ) END END This configuration seems to work - I will test it some more... If anywone has an idea why the previous examples didn't work - I'd be happy to hear it out... Regards, Adrian Adrian Popa wrote: Thanks, Andreas, I've tried your solution (and already looked over the manual) but it still doesn't match anything... Also - EXPRESSION ([myColumn] =~ /MYREGEXP/i) doesn't match anything and EXPRESSION [myColumn] =~ /MYREGEXP/i complains of a syntax error. myColumn is the exact same thing as what I use in the layer's CLASSITEM definition. I am puzzled... I think I'm using the EXPRESSION syntax the wrong way, but I'm not sure what I'm doing wrong. Regards, Adrian Andreas Albarello wrote: Adrian Popa wrote: EXPRESSION (/MYREGEXP/i)- doesn't work (doesn't match anything) EXPRESSION /MYREGEXP/i - works EXPRESSION [myColumn] ==1 - doesn't work (loadClass(): Unknown identifier. Parsing error near (=)) EXPRESSION ([myColumn] ==1) - doesn't work (doesn't match anything) EXPRESSION ([myColumn] eq 1) - works EXPRESSION (/MYREGEXP/i) ([myColumn] eq 1) - doesn't work (doesn't match anything) EXPRESSION /MYREGEXP/i ([myColumn] eq 1) - doesn't work (loadClass(): Unknown identifier. Parsing error near ()) EXPRESSION ((/MYREGEXP/i) ([myColumn] eq 1)) - doesn't work (doesn't match anything) I have checked my data and it should match - most likely, my expression is wrong. Any suggestions? What is the correct syntax for mixing regular expressions with other values? Adrian, have a look at this: http://mapserver.org/mapfile/expressions.html As far as mixing regular and other expressions goes, this is the correct way to do it: EXPRESSION (([myColumn] =~ /MYREGEXP/i) ([myColumn] eq 1)) Best regards, ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Problems when using complex expressions
Adrian Popa wrote: Thanks, Andreas, I've tried your solution (and already looked over the manual) but it still doesn't match anything... Also - EXPRESSION ([myColumn] =~ /MYREGEXP/i) doesn't match anything and EXPRESSION [myColumn] =~ /MYREGEXP/i complains of a syntax error. Adrian, brackets are always required around expressions like that, so that explains why the second example you posted doesn't work. The first one, however, should. I'll admit, though, that I've never used it with the /i (case-insensitive, I guess) at the end. Best regards, -- Andreas Albarello Analysis SW Development Territorium Online srl/GmbH Via Buozzi Str. 12 I 39100 Bolzano/Bozen Phone: +39 0471 068611 Fax:+39 0471 068619 email: andreas.albare...@territoriumonline.com web: http://www.territoriumonline.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users