Start with this file:
msgid "a string"
msgstr ""
msgid ""
"A longer string wraps "
"on multiple lines."
msgstr ""
Grep RegEx to replace all msgstr
lines like this:
msgid "a string"
msgstr "{a string}"
msgid ""
"A longer string wraps "
"on multiple lines."
msgstr ""
"{A longer string wraps "
"on multiple lines.}"
In my infinite naiveté, I would search for
\bmsgid "\b(*)\b"
msgstr "\b
...to replace it with
msgid "\1"
msgstr "{\1}"
But this doesn't get me anywhere. After searching the web and trying to adapt various solutions for Java or C#, I gave up and decided to ask here.
The file syntax you see above if for .PO translations files.
I am using a text editor for this, TextWrangler on Mac OS, which supports Grep RegEx syntax.
Thank you.