Reply To: Anyone willing to correct a GREP expression

#66457

I convert files for printed books into ebooks and need a code to automatically add anchors and links to manuscripts that have hundreds and hundreds of footnotes. So far GREP has been able to do a good job, except this expression that’s intended to create an anchor (a id=”#”) based on the footnote number. It will only return the first digit of the footnote, so that footnotes 10 -19 return as “1” and 20-29 return as “2”, etc. I’m just not savvy enough to spot the error.
SEARCH EXPRESSION: (<span class=”xfootnote”>\[<a href=”#r)(\d+?)
REPLACE EXPRESSION: $1$2
I apologize in advance for being so stupid. Thanks!

This article was last modified on December 18, 2013

Comments (0)

Loading comments...