indesign compound search


I’m trying to find the easiest way to do a compound search in Indesign. This has to do with a foonote/endnote situation.

In short, I’m trying to find a number (in superscript) at the beginning of a sentence followed by a space (not superscript), and replacing this space with a tab.

The problems so far:

  • I can’t find a way to search for numbers greater than 9. The search function in Indesign has the possibility to search for a number with the property {find text:“^9”}, but this will treat 50 as a 5 and a zero. I’ve built a repeat loop that checks for the occurence of a number and when found adds 1 to this number and searches again. The end result is the maximum value I should search for. But this requires all numbers to be consecutive, so this solution is not rock solid.
  • And if I find a number, I can’t figure out how to check if the next character is a space. I could do the search for a number-space combination, but this goes sour because the search is for a superscript number and a non-superscript space.

Any help with either of these problems is greatly appreciated.

Thanks in advance,