[ python-Bugs-995522 ] PEP 263 regular expression fails

SourceForge.net noreply at sourceforge.net
Wed Jul 21 22:52:04 CEST 2004


Bugs item #995522, was opened at 2004-07-21 22:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=995522&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Sjoerd Mullender (sjoerd)
Assigned to: Nobody/Anonymous (nobody)
Summary: PEP 263 regular expression fails

Initial Comment:
Bug 995206 triggered me in trying the regular
expression given in PEP 263 for the encoding syntax. 
This is the result (on Linux, with a failry up-to-date
Python):

Python 2.4a1+ (#1, Jul 19 2004, 08:51:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import re
>>> re.compile(r"coding[:=]\s*([\w-_.]+)")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/sjoerd/src/python/Lib/sre.py", line 179,
in compile
    return _compile(pattern, flags)
  File "/home/sjoerd/src/python/Lib/sre.py", line 230,
in _compile
    raise error, v # invalid expression
sre_constants.error: bad character range
>>>

It seems to me that the PEP's regular expression should
be fixed (or re has a bug).


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=995522&group_id=5470


More information about the Python-bugs-list mailing list