1

OK, so this is really weird. I'm running this GREP to add space between closing quote marks/apostrophes and footnotes.

Find:

(~])(~F)

Change:

~]~|$2

This works great when I change them one by one, but when I hit the 'change all' button it just deletes all the found footnotes! I have hundreds of footnotes to change so any help would be much appreciated as I don't really want to change them one at a time when this should be unnecessary.

1 Answers1

2

The idea is to not touch the footnote marker while still looking for it. A search using a lookahead: ~](?=~F) and changing it to ~]~| should work

cybernetic.nomad
  • 6,100
  • 3
  • 18
  • 31
  • thanks! It works without the ? at the end (it adds a question mark as is). If you want to amend the code I'll mark it as the correct answer. Thanks again. Out of interest, do you know why the original code worked when applied manually but not as a 'change all'? I'm still fairly new to GREP and just as I think I'm beginning to understand it I get blindsided by something like this! – Daniel James Smith Jul 27 '21 at 10:51
  • 1
    Edit done. I have no answer for why InDesign acts that way, my approach was just to side-step the whole issue with the look-ahead. As you have seen, Grep is powerful and can powerfully mess up your text. For this reason, I tend to prefer the use of look-aheads and look-backs since I am then certain those chunks of text will not be touched when doing the replace. – cybernetic.nomad Jul 27 '21 at 15:31