[英]sed regex to replace multiple occurrences
The following sed expression is meant to operate on LaTeX source code and replace citet
with citep
:以下 sed 表达式旨在对 LaTeX 源代码进行操作并将
citet
替换为citep
:
sed -i -e 's/\\citet/\\citep/'
However, it seems that if citet
appears twice in a row但是,似乎如果
citet
出现两次
\citet{bichot2011graph} \citet{DBLP:journals/corr/BulucMSSS13}
it replaces only the first occurrence and turns it into:它仅替换第一次出现并将其转换为:
\citep{bichot2011graph} \citet{DBLP:journals/corr/BulucMSSS13}
Where is the mistake?错误在哪里?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.