I want to use a GREP style to italicize a portion of a company name. For example: "In*Design*." Design is only italicized when it follows the word "In" but "Design" never appears italicized when it stands by itself.
Asked
Active
Viewed 1,256 times
0
-
1And I want free pizza and a pony. – spencer7593 Jul 01 '14 at 20:58
-
Maybe give us what you have tried to do this already? what has somewhat worked and what hasnt? – Chase Jul 01 '14 at 21:46
1 Answers
1
Piece of cake. Use Lookahead and Lookbehind codes to limit the match to "InDesign" only. Use word boundaries to make sure the entire word gets matched.
That leads to
(?<=\bIn)Design\b
where (?<=\bIn)
is the lookbehind part: only "Design" should match when preceded by "In". The \b
before and after indicate a word break -- there may not be an additional word character before or after the phrase. So it will match "InDesign" but not "inDesign" (GREP is case sensitive by default), "wInDesign" (a word character before the \b
word break), or "InDesigner" (a word character after the last \b
word break).

Jongware
- 22,200
- 8
- 54
- 100