fork download
  1. import re
  2.  
  3. regex = r"([.,:;!)|\]])\s*([a-zA-Z]+)"
  4. s = "This is text.Another text.Next case"
  5. print(list(map(lambda x: f"{x[0]} {x[1]}", re.findall(regex, s))))
Success #stdin #stdout 0.02s 9516KB
stdin
Standard input is empty
stdout
['. Another', '. Next']