Reply To: GREP Styles – Is this possible?

Home Page / Forums / General InDesign Topics (CLOSED) / GREP Styles – Is this possible? / Reply To: GREP Styles – Is this possible?

#58459

(FYI, 'cause David's solution is easier ;) ) Using GREP styles, you would use this:

^.+?[-:]

or, if this 'hyphen' is actually an en-dash as in your post, replace – with the GREP code for an en:

^.+?[~=:]

It's quite simple — for a GREP match, that is. ^ is “Start of Paragraph” (and — ugh! — also Start of a line after a soft line break), .+? is “any character, as least as possible (indicated by the question mark; without, it'd be “as often as possible”), and the […] stuff is a list of “one of the characters in this list”. Note: most “special” characters inside an OR-list loose their magic properties — a period or question mark is just that — but a few oddballs have to be escaped to work. If you don't escape the single hyphen, it could be interpreted as a character range instead (as in “a-z”), and you will be wondering forever what you did wrong.

This article was last modified on January 21, 2011

Comments (0)

Loading comments...