


GREP Styles: GREP is a powerful way to find things.Like nested styles, line styles start at the beginning of a paragraph. For example, the first line can get one character style, and the second line can get another character style. Line Styles: These work virtually the same way as nested styles, but instead of styling text up to a specific character, they style based on a number of lines.After that, it will apply the second nested style up until its desired character. You can chain several nested styles one after another, with the first nested style starting from the beginning of a paragraph up until it finds your desired character. For example, you could bold text through the first colon. Nested Styles: Nested styles let you apply character styles to text within a paragraph, starting at the beginning of a paragraph, and ending at a specific character.If there’s a reproducible pattern, you may be able to automate it with nested styles, lines or GREP styles. Sometimes you want to format parts of that paragraph with a character style. Use to add superscript to ordinal numbers such as 2nd, 15th etc.Paragraph styles format an entire paragraph of text at a time. Apply a character style with No break checked to the last whitespace character in a paragraph.

Prevent orphaned words at end of a paragraph. Here are some useful GREP examples that you might want to try, but feel free to add your own examples in the comments section.įind duplicate words that are right next to each otherįind a UK price formatted in various standard email addresses The two main places where you can use GREP are in the GREP styles which can be found within the Paragraph Styles formatting options, and within the Find / Change options. You could use GREP styles to apply a particular character style to all email addresses in a document for example, or you could use GREP to do something simple like remove extra spaces at the end of each paragraph. GREP (regular expressions) can be a very powerful solution both for finding and formatting text that matches a specific pattern, within your InDesign documents.
