Within classes I'm able to match strings using CLASSITEM, but not when including the field name in the expression, for example (inside a layer declaration):
CLASSITEM "myfieldname" CLASS EXPRESSION "sometext" END
Works fine, but
CLASS EXPRESSION ([myfieldname] = "sometext") END
Doesn't return any data
The second method is fine when working with integers, e.g.
CLASS EXPRESSION ([myintegerfieldname] = 10) END
I've tried enclosing the strings with single quotes, double quotes, using a regex instead. The same behaviour occurs when the source data is a shapefile or a postgis layer.
Using CLASSITEM is obviously a good work-around, but it would be useful to know what I'm doing wrong with the direct comparison.