[web2py] Re: IS_MATCH problem with backslashes

2013-07-11 Thread Anthony
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'

[web2py] Re: IS_MATCH problem with backslashes

2013-07-11 Thread Anthony
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\b

[web2py] Re: IS_MATCH()

2011-11-12 Thread annet
Jonathan, Thanks for your explanation. Kind regards, Annet.

Re: [web2py] Re: IS_MATCH()

2011-11-11 Thread Jonathan Lundell
On Nov 11, 2011, at 9:12 AM, annet wrote: > Thanks for your reply. What do you mean by anchoring the search? In a regular expression, ^ matches the beginning of the string, and $ matches the end; I'm referring to those as anchors. So ^xyz$ matches only "xyz", but the pattern xyz matches (for ex

[web2py] Re: IS_MATCH()

2011-11-11 Thread annet
Hi Jonathan, Thanks for your reply. What do you mean by anchoring the search? Kind regards, Annet

[web2py] Re: IS_MATCH() changing a valid value ?

2011-02-06 Thread Ken
Thank you! I am pleased with this resolution. On Feb 6, 1:22 am, Massimo Di Pierro wrote: > In trunk > > IS_MATCH(...,strict=True)  # true is default now and it does append > the '$' is missing. > > On Feb 4, 8:17 pm, Ken wrote: > > > That change would have prevented my problem. However, would i

[web2py] Re: IS_MATCH() changing a valid value ?

2011-02-05 Thread Massimo Di Pierro
In trunk IS_MATCH(...,strict=True) # true is default now and it does append the '$' is missing. On Feb 4, 8:17 pm, Ken wrote: > That change would have prevented my problem. However, would it > guaranty that the returned (accepted) match.group() value would never > differ from the input value? I

Re: [web2py] Re: IS_MATCH() changing a valid value ?

2011-02-05 Thread Jonathan Lundell
On Feb 4, 2011, at 6:17 PM, Ken wrote: > > That change would have prevented my problem. However, would it > guaranty that the returned (accepted) match.group() value would never > differ from the input value? I am worried about more complex queries > now. I still think that if IS_MATCH() finds tha

[web2py] Re: IS_MATCH() changing a valid value ?

2011-02-04 Thread Massimo Di Pierro
Validators are filters. They do not always return what is passed as input. It is a feature. For example IS_INT_IN_RANGE() takes a string and returns an int. IS_DATE, takes a string in the internationalization format and returns a datetime.date(). IS_SLUG(), sluggifies (probably the verb does not ex

[web2py] Re: IS_MATCH() changing a valid value ?

2011-02-04 Thread Ken
That change would have prevented my problem. However, would it guaranty that the returned (accepted) match.group() value would never differ from the input value? I am worried about more complex queries now. I still think that if IS_MATCH() finds that it has accepted something that is not the input

Re: [web2py] Re: IS_MATCH() changing a valid value ?

2011-02-03 Thread Jonathan Lundell
On Feb 3, 2011, at 3:03 PM, Ken wrote: > > You are right. Having (re)read the documentation for re, I find that > it is working as advertised. My original regex was wrong. However, I > would argue that if the match found by regex.match() is different from > the input value, IS_MATCH should return

[web2py] Re: IS_MATCH() changing a valid value ?

2011-02-03 Thread Ken
You are right. Having (re)read the documentation for re, I find that it is working as advertised. My original regex was wrong. However, I would argue that if the match found by regex.match() is different from the input value, IS_MATCH should return an error. That is, in the IS_MATCH.__call__ defini

[web2py] Re: IS_MATCH() changing a valid value ?

2011-02-02 Thread Massimo Di Pierro
This is the correct behavio of regular expressions. Anyway, good that you are pointing this out since others may find it counter intuitive. Massimo On Feb 2, 6:33 pm, Ken wrote: > I have been having trouble with truncation of data from one field of a > form. The culprit turned out to be the IS_M