Message155104
| 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:43 | ezio.melotti | set | recipients:
+ ezio.melotti, mrabarnett, Phillip.M.Feldman |
| 2012年03月07日 17:47:43 | ezio.melotti | set | messageid: <1331142463.7.0.654875996244.issue14221@psf.upfronthosting.co.za> |
| 2012年03月07日 17:47:43 | ezio.melotti | link | issue14221 messages |
| 2012年03月07日 17:47:42 | ezio.melotti | create |
|