Finding Formatted Text

Just like in the Text tab, in the GREP tab you can find text using regular expressions and formatting codes. For example, to find all sequences of two or more capital letters that have been formatted as smallcaps, use the search pattern we saw earlier, \u\u+, and specify Small Caps in the Find Format area. Another example: let us think how we would go about finding paragraphs formatted in bold from beginning to end. To find a whole paragraph, we need to match from its beginning to its end and capture everything in between:

^.+$

To find the paragraphs set from beginning to end in bold, simply go into Find Format and pick Bold in Basic Character Formats.

Get GREP in InDesign CS3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.