Copy link to clipboard
Copied
Hi,
I''m cleaning up a manual TOC.
What would the GREP expression be for the following
Topic 1...................10
Topic 2.............................12
Final result needs to look like this
Topic 1
Topic 2
tia
1 Correct answer
If you want to remove those full stops and digits at the end, use this:
\.+\d+$
and replace with nothing. This will not affect any text and/or formatting at the start of each line.
Copy link to clipboard
Copied
Hi There,
Try the following
Find what
(Topic\s+\d+).+
Replace with
$1
-Manan
Copy link to clipboard
Copied
If you want to remove those full stops and digits at the end, use this:
\.+\d+$
and replace with nothing. This will not affect any text and/or formatting at the start of each line.
Copy link to clipboard
Copied
Thanks everybody,
@_Jongware, This almost works perfectly.
I noticed that the . is followed by a space. My bad, sorry.
So the text is Topic. . . . 123
I've tried \.\s+\d+$ but it only takes away the last . \d\d
This works, but I lose the paragraph break a the end \.\s+\d+
tia
Copy link to clipboard
Copied
Please show a screenshot of the table of contents of your InDesign file with 'show hidden characters'.
One shot into darkness:
Are your "points" real points?
Or only a tab with fill characters?
If this is the case:
\t\d+$
replace with
nothing
should do the job.
Copy link to clipboard
Copied
[\h\.]\d+
Copy link to clipboard
Copied
My crystal ball isn't clean enough.
Again (to quickly find a final solution):
@pixxxel_schubser wrote: "… Please show a screenshot of the table of contents of your InDesign file with 'show hidden characters' …"
for example:
\h(\.\h)+\d+
 
Copy link to clipboard
Copied

