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.
arrow
arrow
    全站熱搜

    wenching520 發表在 痞客邦 留言(0) 人氣()