


Possible? (Would also be useful for quotation marks around italic text, but would have to account for punctuation inside the one at the end.) I’d love to be able to have it look for (~j and check to see whether the next ) is preceded by ~j and only change them if both are matches. Then I did a find query that looks for ( followed by a non-joiner OR a non-joiner followed by ) and changes it to italics: ((()(~j)|(~j)()))

I’m sure these can be made more powerful or more efficient, but I’m ecstatic at the results I got from 5 minutes of effort.įor the parentheses issue I used + (as above) but altered the Change To field to put non-joiners both before and after the italics: ~j$0~j. In 2012 ( ) Jongware provided GREP that could pretty much do the job with some workarounds, but none of those expressions work anymore. Have posted about it in the forums more than once. I asked about it in a GREP session at PepCon 2014 (was told it couldn’t be done). at the end of an italicized word, or non-italic parentheses at either end (or both ends) of text in italics. For example, a non-italic comma/semicolon/colon/etc. In fact, I just did a little experimenting and found preliminary solutions to a problem I’ve wanted to solve since I started using InDesign (either ID 2.0 or CS, 2003-ish, when I’d never heard of GREP and don’t even know if ID had it): to search for non-italic characters (usually punctuation) touching italic ones. The only thing left to do is clean up the non-joiners, with the following: (any letter of any language, zero or more times, followed by a non-joiner, followed by any letter of any language, zero or more times) Now, we need to find all the non-italics before and after the non-joiner and make them italic. They look like carons (upside down carets). The purpose of the non-joiner is to be a zero-width marker at the end of italic formatting.Īfter running the Find/Change, you can see the non-joiners if you show hidden characters. Together, these conditions match everything in italic except breaks. Open Find/Change and in the GREP tab, enter the following: All these words should be italic except “are”) The solution:
