[Python-bugs-list] [ python-Bugs-529708 ] error in re docs or in sre

noreply@sourceforge.net noreply@sourceforge.net
Wed, 13 Mar 2002 17:39:18 -0800


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

Category: Regular Expressions
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Ben Wolfson (rumjuggler)
Assigned to: Fredrik Lundh (effbot)
Summary: error in re docs or in sre

Initial Comment:
The docs for positive lookbehind assertions state that
"(?<=abc)def will match "abcdef", since the lookbehind
will back up 3 characters and check if the contained
pattern matches", but that doesn't gibe with experience:

>>> import re
>>> f = re.compile('(?<=abc)def')
>>> print f.match('abcdef')
None
>>> 

I don't know enough about REs to know if this is a
documentation error or an sre error, though.

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

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