【发布时间】:2014-07-25 07:37:07
【问题描述】:
我有以下代码:
import re
targetFile = open("test.txt").read()
print(re.search('(<\\/nesting_tag>)',targetFile))
我的想法是我返回 .例如。测试时的“测试”。我如何返回“测试”而不是 <_sre.sre_match>?
【问题讨论】:
-
请给出正确的示例输入。
-
@JHarley 如果我的回答解决了您的问题,请确认。谢谢!