Notepad++查找并替换常量字符串

Notepad++查找并替换常量字符串

使用 notepad++ 我有以下文本。

This little piggy went to market, \cite{smith1774}
This little \cite{ben1864} piggy stayed \cite{mueller2867} home,
This little piggy had roast beef

我想找到并删除所有\cite{..}所以我只剩下童谣

答案1

搜索菜单,替换

搜索模式:正则表达式

查找: \\cite\{[^{]*\}
替换:( 无)

匹配:

\\    - literal backslash
cite  - the word cite
\{    - literal {
[^{]* - any number of any character other than {
\}    - literal }

相关内容