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
<TIle renamed by MOD>
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
Copy link to clipboard
Copied
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