Re: regexp compilation error

2011-10-11 Thread Ovidiu Deac
Thanks for the answer. I will give a try to pypy regex. On Fri, Sep 30, 2011 at 4:56 PM, Vlastimil Brom wrote: > 2011/9/30 Ovidiu Deac : >> This is only part of a regex taken from an old perl application which >> we are trying to understand/port to our new Python implementation. >> >> The origina

Re: regexp compilation error

2011-09-30 Thread Vlastimil Brom
2011/9/30 Ovidiu Deac : > This is only part of a regex taken from an old perl application which > we are trying to understand/port to our new Python implementation. > > The original regex was considerably more complex and it didn't compile > in python so I removed all the parts I could in order to

Re: regexp compilation error

2011-09-30 Thread Hans Mulder
On 30/09/11 11:10:48, Ovidiu Deac wrote: I have the following regexp which fails to compile. Can somebody explain why? re.compile(r"""^(?: [^y]* )*""", re.X) [...] sre_constants.error: nothing to repeat Is this a bug or a feature? A feature: the message explains why this pattern is not all

Re: regexp compilation error

2011-09-30 Thread Steven D'Aprano
Ovidiu Deac wrote: re.compile(r"""^(?: [^y]* )*""", re.X) > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.6/re.py", line 190, in compile > return _compile(pattern, flags) > File "/usr/lib/python2.6/re.py", line 245, in _compile > raise error,

Re: regexp compilation error

2011-09-30 Thread Ovidiu Deac
This is only part of a regex taken from an old perl application which we are trying to understand/port to our new Python implementation. The original regex was considerably more complex and it didn't compile in python so I removed all the parts I could in order to isolate the problem such that I c

Re: regexp compilation error

2011-09-30 Thread Chris Angelico
On Fri, Sep 30, 2011 at 7:26 PM, Ovidiu Deac wrote: > $ python --version > Python 2.6.6 Ah, I think I was misinterpreting the traceback. You do actually have a useful message there; it's the same error that my Py3.2 produced: sre_constants.error: nothing to repeat I'm not sure what your regex i

Re: regexp compilation error

2011-09-30 Thread Ovidiu Deac
$ python --version Python 2.6.6 On Fri, Sep 30, 2011 at 12:18 PM, Chris Angelico wrote: > On Fri, Sep 30, 2011 at 7:10 PM, Ovidiu Deac wrote: >> I have the following regexp which fails to compile. Can somebody explain why? >> > re.compile(r"""^(?: [^y]* )*""", re.X) >> Traceback (most recen

Re: regexp compilation error

2011-09-30 Thread Chris Angelico
On Fri, Sep 30, 2011 at 7:10 PM, Ovidiu Deac wrote: > I have the following regexp which fails to compile. Can somebody explain why? > re.compile(r"""^(?: [^y]* )*""", re.X) > Traceback (most recent call last): >  File "", line 1, in >  File "/usr/lib/python2.6/re.py", line 190, in compile >

regexp compilation error

2011-09-30 Thread Ovidiu Deac
I have the following regexp which fails to compile. Can somebody explain why? >>> re.compile(r"""^(?: [^y]* )*""", re.X) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/re.py", line 190, in compile return _compile(pattern, flags) File "/usr/lib/python2.6/