fork(1) download
  1. import re
  2. s="this is, a placeholder text. I wanna remove symbols like ! and ? but keep @ & # & :)"
  3. print(re.sub(r'([#@\s]|:[)(])|\W', r'\1', s))
  4.  
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
this is a placeholder text I wanna remove symbols like  and  but keep @  #  :)