On Apr 1, 9:38 pm, Rehceb Rotkiv <[EMAIL PROTECTED]> wrote:
> In the re documentation, it says that the matching functions return "non-
> overlapping" matches only, but I also need overlapping ones. Does anyone
> know how this can be done?

Something like the following:

import re

s = "oooooooo"
p = re.compile("oo")
out = []

while pos < endpos:
    m = p.search(s, pos)
    if not m:
        break
    out.append(m)
    pos = m.start() + 1


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to