fork(9) download
  1. import re
  2. regex = r"([^\W_])\.(?:\s+|$)"
  3. ss = ["I want a hotel.","my email is zob@gmail.com", "I have to play. bye!"]
  4. for s in ss:
  5. result = re.sub(regex, r"\1 . ", s).rstrip()
  6. print(result)
Success #stdin #stdout 0s 23352KB
stdin
Standard input is empty
stdout
I want a hotel .
my email is zob@gmail.com
I have to play . bye!