Or alternatively:

IS_MATCH('\\\\\\\\server\\\\', 'You must provide a valid location')

but don't do that. ;-)

For more details, see 
http://docs.python.org/2/howto/regex.html#the-backslash-plague.

Anthony

On Thursday, July 11, 2013 8:15:56 PM UTC-4, Anthony wrote:
>
> Maybe try:
>
> IS_MATCH(r'\\\\server\\', 'You must provide a valid location')
>
> Anthony
>
> On Thursday, July 11, 2013 6:00:46 PM UTC-4, Josh Grigonis wrote:
>>
>> I have a form with a text input, and I want to make sure the user entry 
>> is prefixed with a specific UNC path.
>>
>> For example:
>>
>> \\server\blah\blah\file
>>
>> is acceptable
>>
>> \\bad\boo\hoo
>>
>> is not.
>>
>>
>> In order to get this to work, I've tried the following, among other 
>> things:
>>
>> INPUT(_name='file', requires=IS_MATCH('\\\\server\', 'You must provide a 
>> valid location'))
>> INPUT(_name='file', requires=IS_MATCH('^(\\\\)(server)', 'You must 
>> provide a valid location'))
>>
>> Strangely, either of these seems to allow:
>>
>> \server\foo\bar
>>
>> This seems like a bug to me, or is there something else going on subtle 
>> here.
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to