Get to grips with GREP

Okay, strictly this is probably a post that will mostly interest my fellow print designers, but in reality the subject matter is one of efficiency which effects the cost of a job for the customer. Intrigued? Then read on…

What on earth is GREP?
If you want the technical definition it can be found on this wikipedia article, but in essence it is a pattern recognition system. Any word processor can perform a ‘Find and Replace’ for a given word or phrase, but GREP is so much more powerful because you can be less specific in your search. It can even be used to automatically format text as you type (or paste text it in)

I’m a customer – what do I care?
Clever use of GREP will cut down on manually formatting of your artwork and less time equals less cost. For example: lets say your company name needs to be in italics; the first four words of any paragraph need to be in bold or all your phone numbers need to be underlined –  no problem if you use GREP. It makes all artwork more efficient.

There are a lot of sites out there that cover GREP and its use, but one particularly good one can be found at indesignsecrets.com

Okay, show us what it can do…
In my current job as Lead Creative at RCI Europe I work on the member magazine Endless Vacation which provides lots of opportunities to find layout efficiencies including using GREP. The most difficult problem I faced thus far has been to preformat any web adddresses. This would have been comparatively easy if they all started ‘www.’ but the house style is to remove this element. The following code is what I came up with:

(w+|w+-|w+/)*(w+.[lu]+(.[lu]+)*)(/w+(/w+|-w+)*)*

It works for any web address with any domain name, and also works for addresses with subfolders before or after the domain name.

I am relatively new to this, but I already find it to be a fantastically intriguing and incredibly useful tool. If you are a more seasoned GREP professional and you have a much more elegant solution, I’d love to hear from you.

Share this article: Share on LinkedInTweet about this on TwitterShare on FacebookShare on Google+


Pixooma