【发布时间】:2013-04-22 06:29:00
【问题描述】:
我需要从文件中读取数据。
f=open("essay.txt","r")
my_string=f.read()
以下以\nSubject: 开头并以\n 结尾的字符串在my_string 中
Example:
"\nSubject: Good morning - How are you?\n"
如何搜索以 \nSubject: 开头并以 \n 结尾的字符串?
是否有任何 python 函数来搜索字符串的特定模式?
【问题讨论】:
标签: python string python-2.7 split