is now part of CreativePro.com!

Controlling GREP Greediness

This article appeared in Issue 72 of InDesign Magazine.

By nature, GREP is greedy. Regular expressions match as much text as possible, regardless of what you intended. If you search for all text within parentheses—using the expression (.+)—you’ll get every character that appears between the very first opening parenthesis in a paragraph through the very last closing parenthesis in that paragraph. That’s fine if there’s only one set of parentheses in the paragraph, but it’s definitely not what you want when there are several sets of parentheses. So how do you rein in GREP’s greediness?

. . . .

This article is for members only. To continue reading, please sign in, or sign up for a membership today. Thanks for supporting CreativePro!

BECOME A MEMBER

CreativePro membership keeps you up-to-date with the technology, solutions, and resources to strengthen your professional development.

For just $6.50/month (billed annually), you’ll get access to valuable benefits, including:

  • 12 monthly issues of CreativePro Magazine, filled with practical, real-world tutorials written by experts
  • Downloadable resources including templates, fonts, scripts, design assets, cheat sheets, and more
  • Hundreds of members-only tutorial and tip articles
  • Top Tips for InDesign, Photoshop, and Illustrator ebook collection
  • Discounts on events and books
  • and more...

Sign up now!


Adobe Digital Media Solutions Consultant, Designer, author, podcast host, speaker, instructor, tech nerd, husband, father.
>