But that replaces hyphens to en-dashes also in places where it should'nt, such as ISBN numbers, grant numbers, and all other numbers that consist of more than two groups of numbers. It's not so easy automatically to determine where to do the replacement.
Correct. Right after this one, I usually run another that restores regular hyphens where there are more than one single dash, such as in ISBN numbers. This still doesn't catch zip codes, for example, which don't need an en dash: 5630-1234 WI (it's not "5630 up to 1234", or something similar).
However. The GREP does exactly what the OP asked for, so I'm expecting yet another "correct answer" Gold Star
This seems to find only a set of 2 digits sepearated by a hyphen
This set of numbers
How do I replace the hyphen with an N-Dash in all words that are hyphenated because they are at the end of a line of text?
You would not, and cannot. En dashes should not substitute for hyphens. The ones inserted at the end of lines are nearly entirely generated by the hyphenation settings of InDesign's typesetting engine and are not selectable as typed characters.
Eugene -- Exactly five years to the day (per the date stamp) after posting this, you've saved my bacon. Thanks VERY MUCH!