def partial_repeat(string):
    l = len(string)
for i in range(2, l // 2 + 1):
    s = string[0:i]
multi = l // i - 1
factor = l // (i - 1)
ls = len(s)
if s * multi == string[:ls * multi] and len(string) - len(string[:ls * factor]
    ) <= ls and s * 2 in string:
    return s
How can you parallelize a regex search of one long string?