import re

for x in (
    'This is a sample text and this is lowercase text that is repeated.',
    'abcdefabcdef bcdefab'
):
    print(re.findall(r'(.{7,})(?=.*\1)', x, re.S))