Highlighted

GREP expression for a string followed by digits

Adobe Community Professional ,
Jul 11, 2020

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

Most Valuable Participant
Correct answer by Jongware | Most Valuable Participant

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.

TOPICS
How to

Views

122

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

GREP expression for a string followed by digits

Adobe Community Professional ,
Jul 11, 2020

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

Most Valuable Participant
Correct answer by Jongware | Most Valuable Participant

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.

TOPICS
How to

Views

123

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 11, 2020 0
Adobe Community Professional ,
Jul 11, 2020

Copy link to clipboard

Copied

Hi There,

 

Try the following

Find what

(Topic\s+\d+).+

Replace with

$1

 

-Manan

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 11, 2020 0
Most Valuable Participant ,
Jul 11, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 11, 2020 1
Adobe Community Professional ,
Jul 12, 2020

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2020 0
Most Valuable Participant ,
Jul 11, 2020

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.

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 11, 2020 0
Community Beginner ,
Jul 11, 2020

Copy link to clipboard

Copied

[\h\.]\d+

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 11, 2020 0
Most Valuable Participant ,
Jul 12, 2020

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+

Fuellzeichen_weg01.png

 

Fuellzeichen_weg02.png

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 12, 2020 1
Most Valuable Participant ,
Jul 13, 2020

Copy link to clipboard

Copied

?

 

@master_mo, do you need further assistance?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 13, 2020 0