Sed replace quotes
2 answers
You can use the following sed command:
sed 's/"\([^"]\+\)"/\\q{\1}/g' your_file
See a demo to show how this regex works. In sed, you just need to avoid capturing parentheses ( (...)
) and the quantifier +
. The equivalent character must be doubled to represent the literal \
in the replacement pattern, which uses a backreference to the text matched with the first capture group.
+1
source to share