This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tmick
Recipients
Date 2006-04-10.23:11:10
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=34892

I've run into another incarnation of this (it breaks in
Python 2.3.5 and Python 2.4.3):

>>> import sre
  >>> sre.compile("(a*)?")
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "C:\Python24\Lib\sre.py", line 180, in compile
      return _compile(pattern, flags)
    File "C:\Python24\Lib\sre.py", line 227, in _compile
      raise error, v # invalid expression
  sre_constants.error: nothing to repeat

Now granted that the '?' here is redundant for the '*'
quantifier on 'a', but compiling this regex works with
Python 2.3's "pre" and it works in Perl.

The actual use case I've hit here is trying to compile all
the regex's in Fedora Core 5's SELinux config files
(/etc/selinux/targeted/contexts/files/file_contexts*). The
first such regex that broke was:
  '/usr/share/selinux-policy([^/]*)?/html(/.*)?'
History
Date User Action Args
2007-08-23 13:50:29adminlinkissue214033 messages
2007-08-23 13:50:29admincreate