InDesign GREP Styles

GREP can be used in both InDesign’s Paragraph Style and Find/Replace functionality. For those of you whom like the details, check out InDesign Secrets’ Grep Page, as well as Wikipedia for a general description.

What can GREP Styles do for my Proposal/SOQ workflow?

The following examples only scratch the surface of what GREP can do for automating time consuming styles in your documents.

  1. Prevent runts (i.e., a single word left on its own line).
  2. Prevent hyphenation or breaking of company names and other important words or phrases.
  3. Prevent truncating of units after a number
  4. Apply a character style to phone numbers
  5. Apply a character style to email addresses
  6. Apply a character style to a portion of a URL
  7. Superscript copyright symbols
  8. Superscript ordinals
  9. Apply a character style to missing information markers

How to use GREP Styles

grep style 1

Open a paragraph style, select “Grep Style” and press the “New GREP Style” button.

If you check the “Preview” check-box in the lower left hand corner, it will make these changes visible prior to closing the paragraph style dialog box. This is handle for testing your GREP Expressions.

Grep Styles have two options. The first is indicates the character style that you want to apply and the second is the expression used to find the text. You can select from existing character styles or create a new one from within this dialog.

grep style 2

The second field is where you place your grep expression. Adobe provides a handy drop-down guide for inserting arguments.

The first illustration depicts the character style “grep – all caps” to the expression “Sligh”. This is an extremely simple example of applying All Caps to any instance of my last name in the document. Let’s talk about an example that you might find useful in your workflow.

Grep Example #1: Placeholder

Have you ever manually applied a color or character style to missing information or items that needed attention? If so, then you know that it requires just as much work to remove it when you fill in the missing information.

Here is a GREP Style that saves a ton of time in my proposal workflow.

grep INSERT swatch“NEEDS ATTENTION” Swatch—Create a special swatch that will not be used for anything else in your document. It should be a contrasting color with no similar colors used. In my workflow, I use magenta. In particular, I use the spot color Pantone Rhodamine Red C. Ill explain why using a spot color can be useful.

grep INSERT char style“NEEDS ATTENTION” Character Style—Create a character style for the GREP Style to apply. It should include the color you selected in the previous step. In addition, I check the Overprint Fill option.

grep INSERT partial grepCreating the GREP Style—This is most useful if you use best practices and base your paragraph styles off of a single default style. If not, then the GREP Style will need to be added to each of the Paragraph Styles that you would like this feature in.

Start with the first part of this expression. As shown above add in all capital letters “INSERT” and apply your NEEDS ATTENTION character style.

grep INSERT partialIn the example above, I have used the all capital INSERT as a placeholder for various items in my document. They automatically appear in my NEEDS ATTENTION color and when I replace with the proper content, the character style is removed.

grep INSERT complete grepAdding the finishing touches—Add the additional characters show above. The complete expression should be:


Breaking this out:

  • INSERT finds all instances of INSERT
  • (\(.+?\))? which may include these contents
  • (\(.+?\))? finds an opening parentheses (backslash is needed to escape the parentheses character)
  • (\(.+?\))? finds one or more characters
  • (\(.+?\))? finds the first instance of a closing parentheses (backslash is needed to escape the parentheses character)

grep INSERT completeNow I can add notes in parentheses immediately following my INSERT marker.

Reasoning for using Overprint Fill or a Spot Color—You have already made your needs attention markers easy to see in your layout. Assuming you do not need overprint in your proposal workflow, which is not likely, InDesign can remind you that you still have unresolved items in your layout.

grep INSERT preflight settingsTurn on Overprinting Applied in InDesign within your preflight profile (discussed in my previous post titled InDesign Preflight, Part 1)

grep INSERT preflightThe preflight report notifies you that overprint is still in your layout.

grep INSERT AcrobatBy using a swatch, you can use Adobe Acrobat’s Ink Manager, which will indicate use of this swatch. This option is a bit redundant. It may be useful if overprint is needed within your workflow or if you do not use spot colors.

Stay tuned for additional real life AEC marketing examples of GREP Styles, including the nine solutions mentioned above.