Reply To: Advanced GREP Statement – This one is a doozy. Can anyone help?

Home Page / Forums / General InDesign Topics (CLOSED) / Advanced GREP Statement – This one is a doozy. Can anyone help? / Reply To: Advanced GREP Statement – This one is a doozy. Can anyone help?

#61792

Pff :D

Here is my take on it–it's a bit unusual as it needs to test every month name. First, you add “Italics” to the entire paragraph style. Then make everything from the start up to and including the speaker's name Roman. Finally, make everything from the start UP TO (and stopping at) the speaker's name back Italics again — this is the same as the previous one except for the very last command sequence (which in addition romanizes everything up to, but excluding, the very first comma).

Roman:

^.+(June|July|Aug.) d+(~=d+)?( (d+ sessions?).)?[^,]+

Italics:

^.+(June|July|Aug.) d+(~=d+)?( (d+ sessions?).)?

Roman again: (for 2nd and further names after “;”)

(?<=; )[^,]+

To make it work for every month you have to add them all :) (But ain't it wonderful that if you do so once, InDesign will do the rest entirely on its own?)

Below these three you can add your other GREP styles to embolden and no-break the various parts — I didn't test those but at a glance I'd say they ought not to interfere with the above ones.

(You are “new to GREP”? Hah! you are giving it a very good first go!)

This article was last modified on March 13, 2012

Comments (0)

Loading comments...