Skip to main content
NaheedM96673165
Known Participant
November 23, 2021
Question

Using GREP to Format

  • November 23, 2021
  • 1 reply
  • 1566 views

I have no idea if this is possible or not, have come across and research GREP style for the first time today, and can't seem to find an answer that helps

Are you able to use GREP to format all text in text box?

As an example I have a text box with a large amount of black text, I would like to change the text colour of all text if a certain word, lets say 'Apple' is present anywhere in this text box

Is there a way to define this in the GREP style?

Thanks

This topic has been closed for replies.

1 reply

Community Expert
November 23, 2021

Try the following in your Grep style

(?i).*Apple.*

And apply a new character style with the desired color.

-Manan

-Manan
Community Expert
November 23, 2021

Or better you could even use the following

(?i).*\bApple\b.*

The previous one would apply the character style if apple is found anywhere in the text even within a work like pineapple. But this one will apply only when apple is present as a word. Also both the options are case insensitive. If you want case sensitive match then remove (?i)

-Manan

-Manan