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

grep for sentences

New Here ,
Apr 03, 2024 Apr 03, 2024

Copy link to clipboard

Copied

I have figure captions in a big document that have two sentences (with periods after them, of course). After I run the List of Figures, I want to remove the second sentence. There are no other periods in each "paragraph," and the second sentence is followed by a tab. I need help to write the grep so it will find all words between two periods (including the second period) so I can delete that second sentence automatically, please. I've tried all sorts of combinations and I can't get it to work.

TOPICS
Scripting

Views

142

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
community guidelines

correct answers 2 Correct answers

Community Expert , Apr 03, 2024 Apr 03, 2024

Unclear what you mean by "run the list of figures" and screen shots always help us help you faster because it removes the guesswork, but taking a stab. 

 

I'm highlighting what I think you are asking for... did I get it right? if you don't need to match the tab, remove the final 

\t. And if by "paragraph" you want them to be paragraphs but they are all one big paragraph, you can replace the tabs with returns and then this should work. 

 

If yes, Find:

\.\K.+\.\t

2024-04-03_20-22-52.png

 

2024-04-03_20-30-36 (1).gif

 

~Barb

 

 

 

 

Votes

Translate

Translate
Community Expert , Apr 04, 2024 Apr 04, 2024

And if you need to keep the tab change the last part to (?=\t)

Votes

Translate

Translate
Community Expert ,
Apr 03, 2024 Apr 03, 2024

Copy link to clipboard

Copied

Unclear what you mean by "run the list of figures" and screen shots always help us help you faster because it removes the guesswork, but taking a stab. 

 

I'm highlighting what I think you are asking for... did I get it right? if you don't need to match the tab, remove the final 

\t. And if by "paragraph" you want them to be paragraphs but they are all one big paragraph, you can replace the tabs with returns and then this should work. 

 

If yes, Find:

\.\K.+\.\t

2024-04-03_20-22-52.png

 

2024-04-03_20-30-36 (1).gif

 

~Barb

 

 

 

 

Votes

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
community guidelines
New Here ,
Apr 04, 2024 Apr 04, 2024

Copy link to clipboard

Copied

Oh YAY!!! It works like a charm! I can't thank you enough!!! I keep having to run new TOC for Figures in this large file because every time it is "final," it isn't! Right now I don't have time to study up on the GREP stuff, but I will. So thank you for getting me over this hump!

Votes

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
community guidelines
Community Expert ,
Apr 04, 2024 Apr 04, 2024

Copy link to clipboard

Copied

And if you need to keep the tab change the last part to (?=\t)

Votes

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
community guidelines
Community Expert ,
Apr 04, 2024 Apr 04, 2024

Copy link to clipboard

Copied

LATEST

Yay! So glad that was what you needed. When you are stumped by an InDesign question, just come back and tell us about it. We are always happy to help. 

 

~Barb

Votes

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
community guidelines