fork download
  1. import re
  2. pattern = r"\s+\w+\s?[:([]\s*"
  3. items = [
  4. "SAD; Happy; ING:train coca",
  5. "SAD; Happy; ING(train coca",
  6. "SAD, Happy, ING[train coca"
  7. ]
  8.  
  9. for item in items:
  10. print(re.sub(pattern, r' ', item))
Success #stdin #stdout 0.02s 9448KB
stdin
Standard input is empty
stdout
SAD; Happy; train coca
SAD; Happy; train coca
SAD, Happy, train coca