[Python-bugs-list] [ python-Bugs-449000 ] re.sub(r'\n', ...) broke

noreply@sourceforge.net noreply@sourceforge.net
Tue, 07 Aug 2001 21:37:17 -0700


Bugs item #449000, was opened at 2001-08-07 21:37
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=449000&group_id=5470

Category: Regular Expressions
Group: Python 2.2
Status: Open
Resolution: None
Priority: 7
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Fredrik Lundh (effbot)
Summary: re.sub(r'\n', ...) broke

Initial Comment:
Fredrik,

I believe the latest changes to re.sub() broke an
endcase in re.sub().

I used to be able to write r'\n' as a pattern and it
would do the same thing as '\n'.
Now this doesn't work any more; '\n' works but r'\n'
doesn't seem to do anything.

I'm guessing this is an endcase handled wrong in the
most recent checkin ("map re.sub() to string.replace(),
when possible" sounds suspicious to me).  I haven't
verified this hypothesis, but it still works in 2.1.1
and is broken in current CVS.

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

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