g = {partial_repeat(test_string[i:]) for i in range(len(test_string))}
results = set()
for x in g:
    if x and (not results or test_string.count(x) >= min(map(test_string.
        count, results))):
        results.add(x)
min(results, key=test_string.index)
How can you parallelize a regex search of one long string?