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 py.user
Recipients docs@python, ezio.melotti, mrabarnett, py.user
Date 2012-04-01.08:16:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

    Similar to regular parentheses, but the substring matched by the group is accessible within the rest of the regular expression via the symbolic group name name. Group names must be valid Python identifiers, and each group name must be defined only once within a regular expression."

>>> chr(255)
>>> 'ÿ'.isidentifier()
>>> import re
>>>'(?P<ÿ>a)', 'abc')
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/", line 176, in wrapper
    result = cache[key]
KeyError: (<class 'str'>, '(?P<ÿ>a)', 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.2/", line 158, in search
    return _compile(pattern, flags).search(string)
  File "/usr/local/lib/python3.2/", line 255, in _compile
    return _compile_typed(type(pattern), pattern, flags)
  File "/usr/local/lib/python3.2/", line 180, in wrapper
    result = user_function(*args, **kwds)
  File "/usr/local/lib/python3.2/", line 267, in _compile_typed
    return sre_compile.compile(pattern, flags)
  File "/usr/local/lib/python3.2/", line 491, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/local/lib/python3.2/", line 692, in parse
    p = _parse_sub(source, pattern, 0)
  File "/usr/local/lib/python3.2/", line 315, in _parse_sub
    itemsappend(_parse(source, state))
  File "/usr/local/lib/python3.2/", line 552, in _parse
    raise error("bad character in group name")
sre_constants.error: bad character in group name

Date User Action Args
2012-04-01 08:16:48py.usersetrecipients: + py.user, ezio.melotti, mrabarnett, docs@python
2012-04-01 08:16:48py.usersetmessageid: <>
2012-04-01 08:16:48py.userlinkissue14462 messages
2012-04-01 08:16:47py.usercreate