In a 300 page document, with hundreds of footnotes, I want to insert thin spaces between single endquotes and footnote markers. The easiest way seemed a GREP search and repace. I search for (\’)(~F) and replace it with $1~<$2. The result is ’ ’ (endquote-thin space-endquote). When I try to replace AB to A-thin space-B in the same way, the result is right. So what's going wrong? (I also tried ~] for the endquote.)
(By the way, I have a workarround, but I'd like to understand how GREP searches work.)
Footnotes aren't really a part of the semi-official GREP definitions, and I imagine the Adobe programmers had to fix a couple of workarounds to make them work at all. They are not simply single characters (quotes, spaces, and possibly text variables are) but "contain" lots of other information, just like anchored objects do. That could be the reason they don't Play Nice with regular GREP operations.
In this particular case, you can work around it searcing for but not replacing the footnote marker code. Look for
and replace with
The combo (?=~F) will find but not include the footnote code, and thus nicely circumvent the problem.
Yes, this works fine. Thanks again!