homepage

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 ezio.melotti
Recipients Phillip.M.Feldman, ezio.melotti, mrabarnett
Date 2012年03月07日.17:47:42
SpamBayes Score 9.181864e-08
Marked as misclassified No
Message-id <1331142463.7.0.654875996244.issue14221@psf.upfronthosting.co.za>
In-reply-to
Content
You forgot to use raw strings:
>>> text = "The cat ate the rat."
>>> print("before: %s" % text)
before: The cat ate the rat.
>>> text = re.sub("(\w+) ate the (\w+)", r"2円 ate the 1円", text)
>>> print("after : %s" % text)
after : The rat ate the cat.
>>> 
(Maybe you should reconsider writing yet another tutorial about regular expressions, and possibly submit patches to improve the official regex howto if you think it's not good enough.)
History
Date User Action Args
2012年03月07日 17:47:43ezio.melottisetrecipients: + ezio.melotti, mrabarnett, Phillip.M.Feldman
2012年03月07日 17:47:43ezio.melottisetmessageid: <1331142463.7.0.654875996244.issue14221@psf.upfronthosting.co.za>
2012年03月07日 17:47:43ezio.melottilinkissue14221 messages
2012年03月07日 17:47:42ezio.melotticreate

AltStyle によって変換されたページ (->オリジナル) /