Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

GREP expression for a string followed by digits

Community Expert ,
Jul 11, 2020 Jul 11, 2020

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

TOPICS
How to
646
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 11, 2020 Jul 11, 2020

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.

Translate
Community Expert ,
Jul 11, 2020 Jul 11, 2020

Hi There,

 

Try the following

Find what

(Topic\s+\d+).+

Replace with

$1

 

-Manan

-Manan
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2020 Jul 11, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 12, 2020 Jul 12, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2020 Jul 11, 2020

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.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2020 Jul 11, 2020

[\h\.]\d+

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 12, 2020 Jul 12, 2020

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.pngexpand image

 

Fuellzeichen_weg02.pngexpand image

 

 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2020 Jul 13, 2020
LATEST

?

 

@master_mo, do you need further assistance?

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