fork download
  1. #!/bin/bash
  2. s='Line title "A" - TOKEN some line with "quotation marks"'
  3. sed -E ':A; s/(TOKEN[^"]*)"/\1/g; tA' <<< "$s"
  4. # => Line title "A" - TOKEN some line with quotation marks
  5. sed -E ':A; s/(TOKEN[^\\"]*(\\.[^\\"]*)*)"/\1\\"/g; tA' <<< "$s"
  6. # => Line title "A" - TOKEN some line with \"quotation marks\"
Success #stdin #stdout 0.01s 5568KB
stdin
Standard input is empty
stdout
Line title "A" - TOKEN some line with quotation marks
Line title "A" - TOKEN some line with \"quotation marks\"