I have the string
"Motor des regionalen Neuen Forums"
and want to replace the quotation marks to have
\q{Motor des regionalen Neuen Forums}
gloablly in a file.
How do I do that with sed? Or any other unix tool? Thanks
You can use the following sed command:
sed 's/"\([^"]\+\)"/\\q{\1}/g' your_file
See demo showing how this regex works.
In sed, you just need to escape capturing parentheses ((...)) and the quantifier +. The escape symbol should be doubled to represent a literal \
in the replacement pattern, where a back-reference to the text matched with the first capturing group is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With