我得到了与图坏引用一个巨大的LaTeX的文件,正则表达式替换,例如它说发现并输出
"... So in the figure 3-12 we see ... similar to figure 3-1..."
,它应该是
"... So in the figure \ref{fig:3-12} we see ... similar to figure \ref{fig:3-1}..."
为了节省时间,我傻,我因子评分查找/替换,如:
发现:figure 3-
取代:figure \ref{fig:3-
其中返回:
"... So in the figure \ref{fig:3-12 we see ... similar to figure \ref{fig:3-1..."
现在右括号
sed 's#/ref{fig:3-\d+#\ref{fig:3-\d+}#g' main.tex
这将产生
"... So in the figure \ref{fig:3-\d+} we see ... similar to figure \ref{fig:3-\d+}..."
什么是错的朋友?谢谢。
您正在匹配文本中的每个\ d + - \ d +'。使图形成为你图案的一部分。 –