【发布时间】:2015-09-30 14:18:00
【问题描述】:
谁能解释一下为什么下面的代码返回一个空列表:
>>> import re
>>> m = re.findall("(SS){e<=1}", "PSSZ")
>>> m
[]
我试图在PSSZ 中查找SS 的出现总数(并结合最多一个不匹配 的可能性)。
我在这里看到了一个类似的代码示例:Search for string allowing for one mismatch in any location of the string
【问题讨论】:
标签: python pattern-matching string-matching