hi guys,Steve<br>A few day ago I post an item &quot; mapserver 5.6 CGI output GeoJSON format &quot; <a href="http://lists.osgeo.org/pipermail/mapserver-users/2012-April/072028.html">here</a> in which I asked a question about  mapserver CGI output GeoJSON,finally with Steve&#39;s help I got it!<pre>
<a href="http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&amp;layer=tielu&amp;mode=nquery&amp;qformat=geojson"></a>URL1:<a href="http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&amp;layer=tielu&amp;mode=nquery&amp;qformat=geojson">http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&amp;layer=tielu&amp;mode=nquery&amp;qformat=geojson</a>. <br>
But  now I want to add where-clause to prefilter,or I want set filter with CGI. The &#39;tielu&#39; layer stored in postgis including these fields: gid,type,name,comment,the_geom,<br>then I execute <br>URL2:<a href="http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&amp;layer=tielu&amp;mode=nquery&amp;qlayer=tielu&amp;qitem=name&amp;qstring=namexx&amp;qformat=geojson">http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&amp;layer=tielu&amp;mode=nquery&amp;qlayer=tielu&amp;qitem=name&amp;qstring=namexx&amp;qformat=geojson</a><br>
but the output is as same as the URL1&#39;s output, in fact the qstring, qitem don&#39;t take affect.<br>I searched  and visited <br><a href="http://www.osgeo.org/pipermail/mapserver-users/2003-April/042003.html">http://www.osgeo.org/pipermail/mapserver-users/2003-April/042003.html</a><br>
and <br><a href="http://lists.osgeo.org/pipermail/mapserver-users/2009-August/062581.html">http://lists.osgeo.org/pipermail/mapserver-users/2009-August/062581.html</a>,  which are all Steve&#39;s  ansewer posts. <br>so I modified tielu layer in the mapfile as Steve&#39;s suggestion,<br>
...<br>    METADATA<br>          &#39;ows_title&#39;    &#39;tielu&#39;<br>          &quot;wfs_title&quot;    &quot;tielu&quot; <br>          ....<br>         &quot;qstring_validation_pattern&quot; &#39;^[A-Z]{2,8}$&#39; <br>    END<br>
...<br> then I execute <br><a href="http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&amp;layer=tielu&amp;mode=itemnquery&amp;qlayer=tielu&amp;qitem=name&amp;qstring=namexx&amp;qformat=geojson">http://192.168.207.100/cgi-bin/mapserv?map=/opt/fgs/www/htdocs/xj1/xj1.map&amp;layer=tielu&amp;mode=itemnquery&amp;qlayer=tielu&amp;qitem=name&amp;qstring=namexx&amp;qformat=geojson</a>,<br>
and returns the error,<br>mapserv(): Web application error. Parameter &#39;qstring&#39; value fails to validate.
msValidateParameter(): Regular expression error. Parameter pattern validation failed.
msEvalRegex(): Regular expression error. String failed expression test.
I have to search and search, but couldn&#39;t work out. any suggestion, thans very much.<br><br><br></pre><br>