【发布时间】:2015-10-22 06:32:17
【问题描述】:
file = open("demo.txt","r")
text = file.read()
def find(info):
match = re.findall(r"info+\w+\d+",text)
if match:
print(match)
else:
print("Not found!")
我的问题是,如何在函数中应用“信息”, 不知道该怎么做。
任何帮助将不胜感激
【问题讨论】:
-
你能说清楚点吗?该函数采用参数
info,但您为findall函数提供参数text... -
很抱歉造成混乱!