how to read full file into buff for re using?

John Machin sjmachin at lexicon.net
Thu Mar 21 07:41:35 EST 2002


"Zoom Quiet" <zoomq at itcase.com> wrote in message news:<a7c32k$2l9g$1 at news.cz.js.cn>...
> i'm chinese python fresh men; help please!
> how to read full file into buff for re object using?
> such as:
> re.sub()
> ??!

import re
print re.sub(r"\bmen\b", "man", file("ni_de_message").read())



More information about the Python-list mailing list