[mapserver-users] A trouble at validation level

Andrea Peri aperi2007 at gmail.com
Tue Apr 4 08:49:16 PDT 2017


Hi Stephen.
Thx a lot for hint.

The right string was this

'^[-a-zA-Z0-9_.\=#\'&%() ]+$'

It was necessary to put the "-" as first and protect the = and ' using
the \ char.

A.


2017-04-04 18:30 GMT+02:00 Stephen Woodbridge <woodbri at swoodbridge.com>:
> Try this:
>
> (^[-a-zA-Z0-9_.=#'&%() ]+$)
>
> If you want '-' in the character class [] it must be the first char in the
> brackets otherwise it is interpreted as a range character. And you should
> not need to escape chars in the [] class with '\'
>
> -Steve
>
>
> On 4/4/2017 9:59 AM, Andrea Peri wrote:
>>
>> Thx Jukka.
>>
>> I see it.
>> But the log of mapserver report me that the same reg-expression is not
>> validation.
>> So this mean the mapserver is not using a real regular expression
>> validator ?
>>
>> [Tue Apr  4 15:54:19 2017].452382 msApplySubstitutions(): Regular
>> expression error. Parameter pattern validation failed.
>> [Tue Apr  4 15:54:19 2017].452433 layer (idtest): failed to validate
>> (procedimento=afa24052-7022-4147-96bc-0478ad0d8c6f) for regex
>> (^[a-zA-Z0-9\-_.\=#'&%() ]+$)
>>
>>
>>
>> A.
>>
>> 2017-04-04 16:53 GMT+02:00 Rahkonen Jukka (MML)
>> <jukka.rahkonen at maanmittauslaitos.fi>:
>>>
>>> Hi,
>>>
>>> The online validator at http://www.regextester.com/ validates your string
>>> with your regexp.
>>>
>>> -Jukka Rahkonen-
>>>
>>> Andrea Peri wrote:
>>> [mapserver-users] A trouble at validation level
>>>
>>> Hi,
>>> I have an error try-ing to validate this string:
>>> afa24052-7022-4147-96bc-0478ad0d8c6f
>>>
>>> The mapserver log return me this error message:
>>>
>>> [Tue Apr  4 15:22:06 2017].223708 layer (idtest): failed to validate
>>> (procedimento=afa24052-7022-4147-96bc-0478ad0d8c6f) for regex
>>> (^[a-zA-Z0-9\-_.\=#'&% ]+$)
>>>
>>> I'm not so skill on regexp, and i'm not able to understand why it is not
>>> validated.
>>>
>>> My mapfile fragment is this:
>>>
>>>     VALIDATION
>>>       'procedimento' '^[a-zA-Z0-9\-_.\=#\'&%() ]+$'
>>>       'default_procedimento' '0'
>>>     END
>>>
>>> Many thx to everyone.
>>>
>>> --
>>> -----------------
>>> Andrea Peri
>>> . . . . . . . . .
>>> qwerty àèìòù
>>> -----------------
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
>>
>>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------


More information about the mapserver-users mailing list