我的re.search的输出返回<_sre.SRE_Match object at 0x10d6ed4e0>,我想知道如何将其转换为字符串?或者更具可读性的形式?
发布于 2014-04-12 11:01:36
你应该这样做:
result = re.search(your_stuff_here)
if result:
print result.group(0)发布于 2017-02-11 05:26:03
如果您想按顺序查看所有组:
result = re.search(your_stuff_here)
if result:
print result.groups()https://stackoverflow.com/questions/23025565
复制相似问题