Using GREP to easily format subheads.
- This topic has 4 replies, 3 voices, and was last updated 8 years, 4 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / General InDesign Topics / Using GREP to easily format subheads.
Learn / Forums / General InDesign Topics / Using GREP to easily format subheads.
Tagged: #GREP #subheads
I have some raw text I am placing into an indesign document. I want to use GREP within the Find and Replace to find paragraphs with less than 35 characters which are preceded by two paragraph breaks. Then I can just replace the text using $1 and change the style at the same time. How do I find this?
I figured the expression would look something like:
\r\r(.{35})
But I am not sure how to ask it to look for only 1 to 35 characters.
This code should find all paragraphs up to 35 characters long:
^.{1,35}$
Ahh, I see you have a response from Mr. Blatner himself…awesome!
:)
Thank you very much. I will give that a go.
Right this is what I have done in the “Find and Replace” dialog.
Find:
(?<=\r\r)(^.{3,60}$)
This allows me to find a short paragraph which is preceded by two paragraph breaks (which is how I am indicating the start of a subhead in my raw text). In my style sheet box I have set “Body text” so it will ignore any heads which have set themselves automatically when I have used Object styling.
Replace:
$1
With style sheet set to “Subhead”.
I then go back at the end and replace my double paragraph breaks with single paragraph breaks.
Simples.
Thanks.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!