fork download
  1. import re
  2. x="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"
  3. pattern = r"(?<!\S)\w(?=(\W))(?:\1\w)+(?!\S)"
  4. print([m.group() for m in re.finditer(pattern, x)])
Success #stdin #stdout 0.03s 9780KB
stdin
Standard input is empty
stdout
['s u p e r', 's.u.p.e.r', 's👌u👌p👌e👌r']