GREP help – selecting paragraph via case
Learn / Forums / General InDesign Topics / GREP help – selecting paragraph via case
- This topic has 2 replies, 2 voices, and was last updated 5 years, 8 months ago by Nigel Massen.
-
AuthorPosts
-
-
August 9, 2018 at 7:19 am #109328Nigel MassenMember
I have two types of paragraphs in a long text (700,000 words).
Parent paragraphs that begin with a fully capitalised word.
Child paragraphs that begin with a word with an initial capital.e.g.
ANEMONE (PLANT) Perennial herbs in the genus Anemone (Ranunculaceae), from Greek anemos = ‘wind’, with a feminine derivation meaning ‘daughter of the wind’ (Pliny claimed it only flowered when the wind blew), giving the alternative name wind flower.
Balkan anemone A. blanda, tuberous, introduced from the Balkans in 1898, with a scattered distribution as a naturalised garden throw-out in woodland, on verges, under park trees and in churchyards in England and south Scotland. Blanda is Latin for ‘smooth’.
‘Balkan anemone …’ is a child of ANEMONE and needs indenting.
Can I use GREP to apply a paragraph style to either of the two paragraphs.
Either (parent) searching for paragraphs that always begin with a word that is fully capitalised?
or (child) searching for a word with only an initial capital?
Thanks for any help.
-
August 9, 2018 at 9:42 am #109363David BlatnerKeymaster
If the word is actually typed in all caps (as opposed to having the All Caps style applied to it in InDesign), you could search for it in the GREP tab of the Find/Change dialog box with this:
^\u\u+?
That means “a cap at the beginning of the paragraph followed by 1 or more cap letters”Then in the Change To field, just type $0 (which means “replace with whatever you found” and then apply a paragraph style in the Change Format area of the dialog box.
To find paragraphs that begin with words that are not all caps, use
^\u\l+
(that’s one uppercase character followed by one or more lowercase) -
August 10, 2018 at 12:41 am #109415Nigel MassenMember
Thanks David!
-
-
AuthorPosts
- You must be logged in to reply to this topic.