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

How to Use GREP for Searching First/Last Character on a Line in InDesign?

Engaged ,
Aug 22, 2024 Aug 22, 2024

Copy link to clipboard

Copied

Hi

 

Is there any way with GREP to  search the first and last characters of a line (not paragraph) as it flows in InDesign? Please see example attached.

 

I'm trying to locate all lines that begin with a hyphen, or terminate with "I" etc so I can reflow them for stylistic purposes, but I'm not sure if GREP can interact with the text flow in this way, and there don't seem to be any hidden characters at automatic line breaks that GREP could locate.

 

Again this is not about the first character in a paragraph, so '^' isn't any use here I don't think.

I'm currently polishing a 400 page book whose author is a bit hyphen/en-dash crazy so having a way to automate this search woud be a lot faster and less error prone.

 

Is this possible?

Many thanks
Richard

 

Capture.JPG

 

<TIle renamed by MOD>

TOPICS
How to , Type

Views

81

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 ,
Aug 22, 2024 Aug 22, 2024

Copy link to clipboard

Copied

Hi @craftycurate:

 

GREP can target seven locations: beginning of word, end of word, word boundary, beginning of paragraph, end of paragraph, beginning of story and end of story. Unfortunately, beginning and end of a line within a paragraph is not an option. 

 

~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
Community Expert ,
Aug 22, 2024 Aug 22, 2024

Copy link to clipboard

Copied

LATEST

@craftycurate 

 

You can either replace space after those shorts with a non breaking space - or use GREP style to apply CharStyle with a NoBreak.

 

https://graphicdesign.stackexchange.com/a/114123

 

This is a GREP style to use:

 

 

(?<=[!\?\.]\s)[^\s]{1,3}\s

 

 

https://community.adobe.com/t5/indesign-discussions/avoid-a-single-letter-at-the-end-of-a-line/td-p/...

 

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