fork download
  1. import re
  2.  
  3. arr = ["mix butter , flour , 1 / 3 c", "sugar and 1-1 / 4 t", "vanilla"]
  4.  
  5. rx = re.compile(r'(?<!/)[ \t](?![ \t]*/)')
  6.  
  7. for i in arr:
  8. print (rx.sub('', i))
  9.  
Success #stdin #stdout 0.03s 9368KB
stdin
Standard input is empty
stdout
mixbutter,flour,1 / 3c
sugarand1-1 / 4t
vanilla