End-of-paragraph is a '$' sign (only and always at the end of your expression). Perhaps your GREP got confused because of your using dollars everywhere -- did you mean to search for a dollar sign? In that case, use '\$' (escaped). That means you can ditch all the '\r' and '\n' in your search.
You should also escape the other special character in your search: the period. As it is, it'll pick up
i any
character, and that probably will be replaced with nothing. Use '\.' to search for a literal period if you want to.
It seems you've heard about the '+' operator (one or more of the last expression) but didn't quite understand it 🙂 It's not necessary to search for "0+|00+" (i.e., a '0' followed by more
b or
two zeros followed by more).
Stringing everything together with "|" (ORs) is not necessary to include 'either with a space or without' -- you can use the Zero-or-Once operator '?'. Just a little handier would be Zero-or-Umpteen -- the '*'. Where '\s?' would only include zero or one space, '\s*' includes zero or any other number.
Putting it all together, I think this should work nicely:
>\.?0+\s*$
In English: Zero or one period, followed by any number of zeros (including a single one), followed by any number of spaces (including none), followed by the end of a paragraph. And that includes end-of-story (additionally, end-of-table-cell as well).
As it is, this will also strip off the zeros for numbers such as "10" (one without a decimal point). It takes a bit more work to ignore these, although it still is possible.
By way of answer to your question, there
i is
a special End-of-Story marker: '\Z'. That works like the '$' code, but it matches the real end of story
i only.