Adobe InDesign GREP

InDesign GREP Search is probably one of the most powerful tools Adobe InDesign has that your not using. GREP Search is an awesome way to find and replace/edit text. With in InDesign you can find GREP Search in several areas, such as the Find/Change dialog box and the GREP Styles section in Paragraph Styles box.

InDesign GREP Search has allowed me to greatly increase and speed up my workflow. By setting up my styles with InDesign GREP Search codes I am able speed through layout better. Here are some of my favorite and most useful codes I use.

No Break GREP Search

When I layout a sales flyer or marketing piece one the things that I am usually asked is please don’t break our product name. Usually this is easy if the name is something short like “Widget “. But some companies have larger product names like “John Smith Widget 5.0. “ These are trickier. I could always do a find and replace/stylize and correct each one manually. But why not save time by having InDesign do it for you.

    1. Create a new character style, title it something like “No Break “. with this only select the No Break check box.
    2. Open up your Paragraph style such as Body and go to the InDesign GREP Style box.
    3. Click New InDesign GREP Style. Choose the No Break Character style we just created and in the To Text: box type in the text you want the style applied to such as “John Smith Widget 5.0. “ This will make sure that anytime the text appears using that style those words will always be together on one line.

Orphan/Widow control InDesign GREP Search

One of the things that bugs me when it comes to page layout is a widow. Any one laying out copy as a designer should never allow widow to happen. Again you can get a little help from InDesign to take care of this for you.

    1. Create a new character style, title it something like “No Break “. with this only select the No Break check box.
    2. Open up your Paragraph style such as Body and go to the GREP Style box.
    3. Click New GREP Style. Choose the No Break Character style we just created and in the To Text: box type in
(\b\w+?\b) (\b\S{1,7}?\b[.!?]\r)

This will look at the paragraphs for a word on a line by itself. It will then combine the word with the previous word and combine them together using the “No Break “ style.

URL Identifier GREP Search

Often you might want to call out URLs using a special format such as Bold, Italic or Underlined, possibly even a different color.

    1. Create a new character style, title it something like “URL “. Give the style the formatting you’d like. I would also recommend that you set the style up with the No Break check box checked (but this isn’t recommended for URLs longer than your text frame.)
    2. Open up your Paragraph style such as Body and go to the GREP Style box.
    3. Click New GREP Style. Choose the URL Character style we just created and in the To Text: box type in
(https?://|ftp://|www)[^~m~.~f~|~S~s~/~.~3~4~% \\r]+[^)(\",:.~m~.~f~|~S~s~/~.~3~4~% \\r~a]

EMAIL Identifier GREP Search

Just like the URL Identifier I sometimes need to look for and stylize an email address. GREP with in InDesign is able to do this as well.

    1. Create a new character style, title it something like “eMail “. Give the style the formatting you’d like. I would also recommend that you set the style up with the No Break check box checked. You could also use the same Character Style used for the URLs if you wanted.
    2. Open up your Paragraph style such as Body and go to the GREP Style box.
    3. Click New GREP Style. Choose the eMail Character style we just created and in the To Text: box type in
[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}

 

Using  InDesign GREP Search in InDesign is a powerful tool. If your not using it you should. But remember there are way more things to do with it.

Have you been using GREP Search? Do you have any neat tricks you’d like to share?