[Qgis-user] attribute query by substring or regexp

Volker Fröhlich volker27 at gmx.at
Thu Jan 27 12:14:16 PST 2011


For shapefiles, the tilde operator doesn't seem to work for queries, but it 
works in the attribute table's search. That could be a starting point for an 
export, if that is acceptable.

FIELD_NAME ~ '^2'

The Regular Expression above selects geometry which's field_name starts with a 
2.

Otherwise you could use LIKE and ILIKE, but they are not as powerful. They 
should also work for querying shapefiles.

And as Noli said, conversion is also a possibility.

You might want to see

http://www.postgresql.org/docs/8.1/static/functions-matching.html


Volker


Am Donnerstag 27 Januar 2011, 02:01:23 schrieb maning sambale:
> Hi,
> 
> Any tips on conducting substring query to limit display of polygons?
> For example, I was given a point shapfile containing a long
> description text n the attribute table and I want to select/display
> only the polygons containing a series of substring/text/values.




More information about the Qgis-user mailing list