InDesign GREP snippets

Roger Farrell

InDesign uses a Perl flavor of regex.1 The following are some useful expressions I have accumulated over the years.

Find page references

\b(([Pp]age)|(p+\.))\s\d+

Remove extra white space

This looks for contiguous white space characters and removes all but the last instance.

Find:

(\s+)(\s)

Replace:

$2

  1. As far as I know this is not documented by Adobe directly. See this question on the graphic design Stack Exchange.↩︎