[mapserver-users] Regular expression error

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Tue Jun 12 08:11:05 PDT 2012


Your regex only allows for 1 character after ogc_fid. I'd rewrite as:

  '^ogc_fid=[0-9]{1,5}$'

This restricts the number a bit more, plus doesn't allow characters before or after. Really you could to:

   VALIDATION
     'ogc_fid'  '^[0-9]{1-5}$'
   END
   FILTER "ogc_fid=%ogc_fid%"

That's a lot cleaner.

Steve

-----Original Message-----
From: Richard Greenwood [mailto:richard.greenwood at gmail.com] 
Sent: Tuesday, June 12, 2012 9:35 AM
To: Lime, Steve D (DNR)
Cc: mapserver
Subject: Re: [mapserver-users] Regular expression error

If I don't have any key/value in the query string I get a whole bunch regular expression errors in the error log. In other words, just the presence of that layer in the map file is generating error. An actual value would look like
   ogr_fid=123456

Thanks,
Rich

On Tue, Jun 12, 2012 at 8:29 AM, Lime, Steve D (DNR) <Steve.Lime at state.mn.us> wrote:
> What value are you trying to validate?
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Richard 
> Greenwood
> Sent: Tuesday, June 12, 2012 9:26 AM
> To: mapserver
> Subject: [mapserver-users] Regular expression error
>
> I am getting the error:
>  msValidateParameter(): Regular expression error. Parameter pattern validation failed.
>
> From the following in my LAYER definition:
>  METADATA
>    'filter_validation_pattern'  'ogc_fid.'
>  END
>  FILTER "%filter%"
>
> And I just can't see what I'm doing wrong. I'd sure appreciate another set of eyes...
>
> Thanks,
> Rich
>
> --
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>



--
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com





More information about the MapServer-users mailing list