Adobe Certified Expert - InDesign CS2
subscribe via iTunes
RSS 2.0

Learn GREP from The InDesigner on Lynda.com

My first course for Lynda.com—InDesign CS4: Learning GREP—is now live on the Online Training Library. This 3-hour, 45-minute title is the first comprehensive, video-based course to be offered about using GREP specifically in InDesign. Starting with an explanation of what GREP is, and how to write expressions using metacharacters, InDesign CS4: Learning GREP covers both GREP Find/Change (CS3 and CS4), and GREP Styles (CS4) in depth.

Exercises demonstrated in the course include:

  • describing figure references in parentheses without styling the parentheses themselves
  • cleaning up inconsistent U.S. phone number formatting
  • describing every e-mail address in the world with one expression
  • simultaneously applying two or more character styles to the same text
  • dynamically preventing orphaned words at the end of a paragraph
  • converting and reformatting spreadsheet data from Excel to produce directory listings
  • inserting anchored objects with Find/Change
  • customizing a text cleanup script

Viewing the full course requires a paid Lynda.com account. However, 9 of the movies in the course are available for non-members to preview. For a 24-hour free pass to the Online Training Library, click here.


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

12 Responses to “Learn GREP from The InDesigner on Lynda.com”

  1. Hi Michael. Congrats for making it on lynda.com! It’s an awesome site & definitely worth the money. Ciao Z

  2. Excellent course. I the course earlier this week and I’d highly recommend it to anyone wanting to learn more about GREP.

  3. Wonderful course, explained in English, with tips about undocumented GREP metacharacters.

    So, I have a question. Is it possible using GREP to find the first instance of a word and style it one way, but find further instances of a word and style it differently? Client wants the first instance of a term styled, but not any further occurrences. I can’t make head or tail out of UNIX guides, but there did seem to be a /m metacharacter for first instance. Any help would be appreciated.

  4. Paeon
    It would be great if your could set Nested Style to an exact “Word” or “Small Phrase”. Anyone know if this is possible?

  5. @Paeon — The only workaround I can think of is to put a unique invisible character around the first instance of the word/phrase (like an End Nested Style character), but not around any of the others. Then, write a GREP expression that requires that unique character be present using Positive Lookahead and/or Lookbehind to apply the “first instance” style. Another GREP expression could describe the word/phrase but only if it isn’t preceded or followed by that unique character (using Negative Lookahead and/or Lookbehind). There’s no GREP expression that determines “first instance” in one step.

  6. @lowjackson — GREP Styles exist to get around exactly that limitation of Nested Styles. If you need to find every instance of a product name (i.e. “SuperWidget”), just create a GREP Style using the text “SuperWidget” and choose the appropriate character style to be applied to it.

  7. Thanks, Michael. I’ll give that a try.

  8. Is there a way to have dynamic changing of phone numbers using GREP Styles? I only that you can apply a character style, but that won’t add the parentheses, etc. And Find/Change permanently changes the text. Is there a solution?

  9. This is the unfortunate either/or choice between GREP Styles and GREP Find/Change. GREP Styles do one thing — apply character styles — but they do it dynamically. GREP Find/Change does more — re-arranges and modifies found text — but it’s permanent. You just have to choose which is the best compromise for your needs on any given task or project.

  10. Hi Michael, first, thanks for posting your tutorial on lynda.com, it is the most comprehensive outline to GREP styles I’ve found thus far.

    I have a question in regards to a style for websites. How do you account for the differences for sites that have include the www (or http) vs ones that don’t as well as those that have a path after the .com vs those that don’t. The closest style I could come up with is
    (www|http).\w+\.(gov|com|edu|org)
    but it doesn’t include everything. Do you have any suggestions?

  11. I’ve tried coming up with a universal method for defining all web sites with one GREP pattern, as I did in the Lynda.com video where I defined every possible e-mail address with one expression. The problem is, e-mail addresses are limited by more strict rules than URLs. A web address can have multiple domains, and people can type them with or without the http:// or the www. in a document (as opposed to e-mail addresses, which must be typed correctly or they’re incorrect). I have yet to find a solution that doesn’t break other things. The challenge is accounting for an http:// that may or may not be there, a www. that may or may not be there, a full domain, a secondary domain that may or may not exist, and some URLs have a slash and specific directory following them. That’s another challenge. I haven’t given up, but I’ve put that problem aside for now. If I resolve it, I’ll post it here.

  12. Thanks Michael. I’ll be sure to check back in and keep trying myself.

Leave a Reply