fork(1) download
  1. import re
  2.  
  3. for x in (
  4. 'This is a sample text and this is lowercase text that is repeated.',
  5. 'abcdefabcdef bcdefab'
  6. ):
  7. print(re.findall(r'(.{7,})(?=.*\1)', x, re.S))
Success #stdin #stdout 0.03s 9768KB
stdin
Standard input is empty
stdout
['his is ', 'e text ']
['bcdefab']