re.sub,flags = re.MULTILINE,在Jupyter上使用python 3

时间:2018-05-30 15:18:37

标签: python-3.x nlp jupyter

我是NLP的新手,想要使用python re库来清理电子邮件。 我已在another post中查看了答案。但我仍然无法弄清楚为什么只过滤掉第一个模式。

cleantext = re.sub(r'^From .*\n', '', text, flags = re.MULTILINE)
cleantext = re.sub(r'^To .*\n', '', cleantext, flags = re.MULTILINE)
cleantext = re.sub(r'^Subject .*\n', '', cleantext, flags = re.MULTILINE)

提前感谢任何暗示!

0 个答案:

没有答案