>
> No way? Famous last words :-)
>
> C:\junk>type showargs.py
> import sys; print sys.argv
>
> C:\junk>\python25\python
> Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import
John Machin wrote:
> On 20/05/2007 10:18 AM, bullockbefriending bard wrote:
>>> Instead of the "or match.group(0) != results" caper, put \Z (*not* $) at
>>> the end of your pattern:
>>> mobj = re.match(r"pattern\Z", results)
>>> if not mobj:
>> as the string i am matching against is coming
On 20/05/2007 10:18 AM, bullockbefriending bard wrote:
>> Instead of the "or match.group(0) != results" caper, put \Z (*not* $) at
>> the end of your pattern:
>> mobj = re.match(r"pattern\Z", results)
>> if not mobj:
>
> as the string i am matching against is coming from a command line
> a
> Here "all pairs different" means "for each pair, both numbers must be
> different", but they may appear in another pair. That is, won't flag
> "1,2/3,4/3,5/2,6/8,3/1,2" as invalid, but this wasn't clear from your
> original post.
>
> --
> Gabriel Genellina
thanks! you are correct that the
> Instead of the "or match.group(0) != results" caper, put \Z (*not* $) at
> the end of your pattern:
> mobj = re.match(r"pattern\Z", results)
> if not mobj:
as the string i am matching against is coming from a command line
argument to a script, is there any reason why i cannot get away wi
> Backslash? Your example uses a [forward] slash.
correct.. my mistake. i use forward slashes.
> Are you sure you don't want to allow for some spaces in the data, for
> the benefit of the humans, e.g.
> 1,2 / 3,4 / 5,6 / 7,8 / 9,10 / 11,12
you are correct. however, i am using string as a co
On 20/05/2007 3:21 AM, bullockbefriending bard wrote:
> first, regex part:
>
> I am new to regexes and have come up with the following expression:
> ((1[0-4]|[1-9]),(1[0-4]|[1-9])/){5}(1[0-4]|[1-9]),(1[0-4]|[1-9])
>
> to exactly match strings which look like this:
>
> 1,2/3,4/5,6/7,8/9
En Sat, 19 May 2007 19:40:39 -0300, bullockbefriending bard
<[EMAIL PROTECTED]> escribió:
> from my cursory skimming of friedl, i get the feeling that the all
> pairs different constraint would give rise to some kind of fairly
> baroque expression, perhaps likely to bring to mind the following
>
thanks for your suggestion. i had already implemented the all pairs
different constraint in python code. even though i don't really need
to give very explicit error messages about what might be wrong with my
data (obviously easier to do if do all constraint validation in code
rather than one regex)
In <[EMAIL PROTECTED]>,
bullockbefriending bard wrote:
> first, regex part:
>
> I am new to regexes and have come up with the following expression:
> ((1[0-4]|[1-9]),(1[0-4]|[1-9])/){5}(1[0-4]|[1-9]),(1[0-4]|[1-9])
>
> to exactly match strings which look like this:
>
> 1,2/3,4/5,6/7,8
10 matches
Mail list logo