Learn the basics of GREP


If you’re looking for a way to supercharge your InDesign skills, there are few things as good as learning a bit of GREP. GREP is a search tool that you can employ to find literal text, but you can also make GREP searches more interesting and more useful by adding certain codes to search for text patterns.

In the March 2014 InDesign Magazine feature Getting a grip on GREP, scripting engineer Peter Kahrel shows you how to formulate GREP search patterns that are much more powerful and useful than InDesign’s standard search-and-replace tools.

Cover of InDesign Magazine 54 (March 2014) with an image of a gloved hand holding a wrench and the feature text 'Get a grip on GREP'.

Topics include finding alternate spellings, finding series of characters, classes of characters, and replacing text. You’ll also find tips on writing out space characters, using backslashes to find literal characters, and placing hyphens, as well as info on the Double Dollar Sign bug and the Footnote bug.

In addition to the feature article, this PDF contains six InDesign Magazine ‘GREP of the Month’ tips, including:

  • A smoother, speedier way to look back (InDesign Magazine 73)
  • Limiting matches (InDesign Magazine 74)
  • Reveal codes (InDesign Magazine 76)
  • Adding section heads (InDesign Magazine 79)
  • Unicode (InDesign Magazine 82)
  • Lookahead (InDesign Magazine 86)

This series of articles is reproduced here in full with permission from the team at InDesign Secrets. Become a member of InDesign Secrets to receive the full version of InDesign Magazine every month, along with a range of other benefits—use the discount code WORKFLOW to get $10 off!

Download PDF

Peter Kahrel

Peter Kahrel

Typefi Scripting Engineer

Peter was born in Amsterdam, the Netherlands. He trained as a linguist at the University of Amsterdam and has an MA and a PhD, specialising in syntax, semantics, and typology. He has lived in the UK since 1994, working as a typesetter, editor, copy-editor, and indexer (and sometimes as a designer too) for publishers in the UK, the Netherlands, and Germany, preparing for the press both books and journals. He combined this with teaching at the Linguistics Department at Lancaster University.

Peter has been programming InDesign with JavaScript since 2003, mainly to cut out the tedium that faces every typesetter and indexer but in equal measure because it’s good fun. Peter has worked as a script developer at Typefi since 2010, and is highly regarded in the global InDesign scripting community.