[Python-bugs-list] [ python-Bugs-529923 ] re module syntax documentation omission

noreply@sourceforge.net noreply@sourceforge.net
Thu, 14 Mar 2002 07:37:02 -0800


Bugs item #529923, was opened at 2002-03-14 15:37
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=529923&group_id=5470

Category: Documentation
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Jon Ribbens (jribbens)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: re module syntax documentation omission

Initial Comment:
The discussion of what the backslash character does in 
the documentation chapter "4.2.1 Regular Expression 
Syntax" is incorrect. In addition to the sequences 
listed, other sequences also work, e.g. "\n", "\x7f", 
etc.

>>> p = r"\x40"
>>> p
'\x40'
>>> re.search(p, "foo@bar")
<_sre.SRE_Match object at 0x183fc0>
>>> re.search(p, "x40")           
>>>

According to the documentation, the first search 
should fail and the second should succeed. In fact, 
the opposite occurs.


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

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