Copy link to clipboard
Copied
Hi.
I have a space before and after every footnote number in the text and I want to remove them, I used
Find: (~F)
Change to: $1
When I do it one by one it works perfectly, but when I use change all it doesn't work it turns them into squares.
What am I doing wrong here?
Hi @AK09M, try this:
((?<=~F) | (?=~F))
This searches for a space with a footnote number before it OR a space with a footnote number after it.
- Mark
Copy link to clipboard
Copied
Can you share a sample document that exibhits this behaviour.
-Manan
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi @AK09M, try this:
((?<=~F) | (?=~F))
This searches for a space with a footnote number before it OR a space with a footnote number after it.
- Mark
Copy link to clipboard
Copied
The problem is not searching but replace and it seems we can't replace a footnote marker with itself using change all, it replaces it with something like <?>. It happens on every document. So I suggest to do this in two steps.
Find What
\x20(?=~F)
Change To:- Leave it empty
Second step
Find What
(?<=~F)\x20
Change To: Again leave it empty
-Manan
Copy link to clipboard
Copied
Hi @Manan Joshi, I think my suggestion works okay—it just targets the spaces, which you can just replace with nothing, so it avoids attempting to replace footnote numbers.
- Mark
Copy link to clipboard
Copied
Thanks for adding this @m1b. I was so engrossed in finding why the replace all is not working that I forgot carefully to look at the grep you mentioned. I just complicated your statement by breaking into two steps. The key here was not replacing the footnote or to say replace by nothing, since you did not emphasize on it, I thought that maybe there is something more to be looked into.
-Manan
Copy link to clipboard
Copied
Hi Mark and Manan,
to make it more clear that there is a space in the GREP expression:
use the Unicode notation.
((?<=~F)\x{0020}|x{0020}(?=~F))
Best,
Uwe Laubender
( Adobe Community Professional )
Copy link to clipboard
Copied
Hi @Laubender,
Thanks for the suggestion. I had used it. I dissected @m1b's expression into two and you combined mine and his into one 🙂
-Manan
Copy link to clipboard
Copied
Good idea!