fork download
  1. import re
  2.  
  3. pattern = r"(?<!\S)\w(\W)(?:\w\1)*\w(?!\S)"
  4.  
  5. s = "This is s u p e r and s.u.p.e.r and s👌u👌p👌e👌r and s!u.p!e.r"
  6.  
  7. matches = re.finditer(pattern, s)
  8.  
  9. for _, m in enumerate(matches, start=1):
  10. print(m.group())
Success #stdin #stdout 0.04s 9828KB
stdin
Standard input is empty
stdout
s u p e r
s.u.p.e.r
s👌u👌p👌e👌r