I am writing a paper with latex and accidentally wrote \cite[]
instead of \cite{}
.
I could just go over the whole document by hand but I want to know how to do this in notepad++ using regexes.
I initially tried \\cite\[(.*)\]
and replace with \cite{\1}
which works for simple cases such as
\cite[hello world] blah blah
However if there are two or more citations in a paragraph it matches all of them. So for example
\cite[aaa]\cite[bbb] something here \cite[ccc]
matches the whole line
How can I get a non greedy match so that the above line would be matched as 3 separate matches and the result of a replace command should give me
\cite{aaa}\cite{bbb} something here \cite{ccc}