InDesign GREP Essentials: What GREP Is and What It Does

1

Part 1 in a series of posts on using GREP in InDesign for beginners

GREP is scary sounding, especially if you’re not someone who like working with code. While the prospect of learning GREP may be very intimidating to a beginner, the payoff is amazing. It can save you many hours of tedious work, and allow you to accomplish things in InDesign that would otherwise be impossible. The hours you invest in learning GREP will be paid back many times over.

In a nutshell, GREP (“Global Regular Expression Print”) finds patterns of text in InDesign and lets you manipulate that text automatically. Even that is a bit nebulous, so here’s an example I think we can all get behind.

Let’s say you wanted to standardize the way phone numbers were displayed in your document, the problem being the text was input by several people, who all used their own different phone number formatting. You could write a GREP string that takes into account all the possibilities and magically transforms the numbers to your liking. That’s more advanced than I’ll cover here, but we will work a bit with phone numbers along the way.
whatgrepdoes
That’s what GREP is, so where do you find it in InDesign? It lives in two places—the Find/Change dialog box and within paragraph styles—each with their own pros and cons.

indesign-grep-paragraph-style-dialog-box

indesign-grep-find-change

The main difference is that when you use Find/Change, you obviously have to re-run the search every time you add or change the text. You also can take full advantage of that dialog box and change the found text (the text that fits the pattern) and style it, change it completely, add to it, delete some of it, and even re-arrange it!

However, when you build a GREP expression into a paragraph style, you can only apply character-level formatting to the found text. There’s no moving around or otherwise manipulating the text. Create a nested GREP style under the GREP Style pane in the Paragraph Style Options dialog box, by entering a GREP expression and indicating which character style to apply.

One thing I always recommend for working with GREP is to keep the search area very specific. I generally search by selected story or even just a small text selection. That way I don’t accidentally format a 10-digit part number like a 10-digit phone number.

Check back for more posts on InDesign GREP tips for beginners. Next up: Using Wildcards

 

Erica Gamet has been involved in the graphics industry for over 35 years. She is a speaker, writer, trainer, and content creator focusing on Adobe InDesign, Apple Keynote, and varied production topics. She is a regular presenter at CreativePro Week, regular contributor to CreativePro Magazine, and has spoken at Canada’s ebookcraft, Adobe MAX, and Making Design in Oslo, Norway. Find Erica online at the CreativePro YouTube channel, CreativeLive.com and through her own YouTube channel. When she isn’t at her computer she’s probably daydreaming about travel or living in a Nordic noir landscape.

Website
LinkedIn
Instagram
  • Me says:

    Part 2? I like Erica’s tutes, but … where is the rest?

  • >