close
http://code.activestate.com/recipes/499314/
import re
starts = [match.start() for match in re.finditer(re.escape(S), T)]
finditer() won't find overlapping strings. The regular expression methods, including finditer(), find non-overlapping matches. To find overlapping matches you need a loop.
import re
starts = [match.start() for match in re.finditer(re.escape(S), T)]
finditer() won't find overlapping strings. The regular expression methods, including finditer(), find non-overlapping matches. To find overlapping matches you need a loop.
全站熱搜
留言列表