0

There's a unique, made-up word in a book I am editing. I need to italicize the first three letters of this word every time it occurs.

So far I have determined that GREP styles are my best shot at automatically formatting this word, but I have not been able to create a GREP string that works. Any help would be welcome!

Edit:

I managed to get a working GREP query, but this only works for me in the Find/Change dialog. I believe that these GREP strings need to be written a little differently depending on where they are used in the program...

By the way, the specific word I am looking for is youniverse. I need you to always be italicized.

My current working Find/Change GREP query is:

you(?=niverse)

This is a basic way to get the result I am looking for. Ideally this would be a GREP Style in my main paragraph style so I could procedurally apply this style every time the word occurs

RobC
  • 22,977
  • 20
  • 73
  • 80
  • **A: Find/Change:** **1)** Set the _"Find What:"_ regexp to `(\byou)(?=niverse\b)` **2)** Set the _"Change to:"_ value to `$1` **3)** Next to _"Change Format:"_ click the _"Specify attributes to change"_ icon, then select _"Basic Character Formats"_, and in the _"Font Style:"_ field select _"italic"_ from the pop up list, then click _"OK"_ button. **4)** Click the _"Change All"_ button. **B: GREP Style:** Or, if you want to add it as a _"GREP Style"_ for the Paragraph Style then set the _"To Text:"_ regexp to `(\byou)(?=niverse\b)` and set the _"Apply Style:"_ to an italic Character Style. – RobC Dec 11 '20 at 15:00
  • Thank you @RobC—I am definitely onto this thing now after getting a basic working GREP query – Daniel Villa Dec 18 '20 at 21:55

1 Answers1

0

If you need to match the first "Dan" of DankFarrik use this in your GREP search and apply appropriate character style:

(Dan|DankFarrik)

You can also try this one

((Dan)(?=kFarrik))
Nicolai Kant
  • 1,391
  • 1
  • 9
  • 23