正则表达式:将以 "msgctxt" 开头的行替换为这些字符串引号之间的内容
RegEx: Replace lines that start with "msgctxt" with content that is in between quotation marks of those strings
我有几个大文件,其中有几个条目如下:
msgctxt "#. client error message"
msgctxt "#. 0 = ID"
#: Some more text
msgid ""
"Could not activate\n"
"Connection lost?"
msgstr ""
"Some other text"
"Even more other text"
现在,理想情况下,我希望所有以 "msgctxt" 开头的行都替换为这些字符串引号之间的内容:
#. client error message
#. 0 = ID
#: Some more text
msgid ""
"Could not activate\n"
"Connection lost?"
msgstr ""
"Some other text"
"Even more other text"
有些条目没有 "msgctxt",其他条目只有一个或几个。
有没有办法在 Notepad++ 中使用正则表达式来做到这一点?
我的猜测是一个简单的表达式,例如,
msgctxt\s+"(.+)"
换成$1就够了。
Demo
我有几个大文件,其中有几个条目如下:
msgctxt "#. client error message"
msgctxt "#. 0 = ID"
#: Some more text
msgid ""
"Could not activate\n"
"Connection lost?"
msgstr ""
"Some other text"
"Even more other text"
现在,理想情况下,我希望所有以 "msgctxt" 开头的行都替换为这些字符串引号之间的内容:
#. client error message
#. 0 = ID
#: Some more text
msgid ""
"Could not activate\n"
"Connection lost?"
msgstr ""
"Some other text"
"Even more other text"
有些条目没有 "msgctxt",其他条目只有一个或几个。
有没有办法在 Notepad++ 中使用正则表达式来做到这一点?
我的猜测是一个简单的表达式,例如,
msgctxt\s+"(.+)"
换成$1就够了。