fork(10) download
  1. subject = 'a b c a b " a b " b a " a "'
  2. regex = /("[^"]*")|a/
  3. replaced = subject.gsub(regex) {|m|$1}
  4. puts replaced
  5.  
Success #stdin #stdout 0.01s 7452KB
stdin
Standard input is empty
stdout
 b c  b " a b " b  " a "