Reply To: Grep to ital between commas if it contains an ' and two numbers

Home Page / Forums / General InDesign Topics (CLOSED) / Grep to ital between commas if it contains an ' and two numbers / Reply To: Grep to ital between commas if it contains an ' and two numbers

#56182

You know, I'll let you off on the “geek” because I'm looking forward to the hugs! That is, if this GREP style works for you:

(?<=,)[^,]*~]dd(?!d)[^,]*(?=,)

It comes with a few features:

  1. It'll start and end at comma's but will not include them into the italics. I usually do it like that because it's typographically correct, in this use, but feel free to scream if you want them italicized anyway.
  2. It does not react to a straight ' before the year, only for the correct character: ’ (the Right Single Quotation Mark). That's the correct character to use; but if you're willing to dispense more hugs, I could make it check for the straight quote as well (just in case some are correct and some are not).
  3. It'll only work when the year has exactly two digits. Try it; the italics will switch off when you accidentally type '1980 or '078 or something like that.

So this GREP is hyper-correct, but don't worry, I can have it relax a bit if you want me to.

This article was last modified on June 27, 2010

Comments (0)

Loading comments...