In the current version of my book I use static referencing but now I want to use dynamic referencing using \label
and \ref
and performing the appropriate substitutions. Some substitution examples are the following:
Figure 5-6 -----> Figure \ref{0506}
Figure 2-17 ----> Figure \ref{0217}
Figure 14-4 ----> Figure \ref{1404}
Figure 34-45 --> Figure \ref{3445}
Figure 12-109 ---> Figure \ref{12109}
Since there are about 2000 such cases I want a regular expression for this (preferably in WinEdt). I was not able to construct such an expression. Can anyone help me with this? Thanks a lot!
Figure 05-06
andFigure 02-17
etc.) you simply search for a regex likeFigure ([0-9]+)-([0-9]*)
and replace withFigure \\ref{\1\2}
or similar – unless WinEdt uses a different syntax, I am not familiar with that program.\label
reference.\ref{3445}
will still work if the document is edited and that figure becomes Figure 35-22, but it will be very confusing for any human reading the source.