I messed up my latex code; I need to replace \cite[42]{source}.
with .\cite[42]{source}
and \cite{source}.
with .\cite{source}
. I tried \\cite\(.*\)\}\. -> .\\cite\1\}
but I got an error: Invalid use of '\' in replacement text
. How do I fix this?
1
2
You don't backslash the curly brace }
in the replacement text. This works, when entered at the query-replace-regexp
prompt:
FROM: \\cite\(.+\)}\.
TO: .\\cite\1}
-
-
+
says "one or more characters after\cite
and before the closing brace" which means that\cite}
will not be matched. It's not a big deal, but I thought it was cleaner. – Ted Zlatanov Feb 2 '15 at 11:33