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

Using GREP to Format

  • November 23, 2021
  • 1 reply
  • 1560 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

NaheedM96673165
Known Participant
November 23, 2021

Thanks for the response @Manan Joshi 

Your solution almost works, I have applied as suggested however it only makes that one paragraph blank, rather then all paragraphs/text in the text box. Any thoughts?

FRIdNGE
Inspiring
December 2, 2021

If your target is the word "FRIdNGE" (or "fridnge" or "FRIDNGE"), use a F/R [a Grep style won't work here!]:

 

Find: (?si).*\bFRIdNGE\b.*

 

(^/)  The Jedi


Addendum:

 

If the target-word could be included too (you talked about "data merging") at the end of the text, directly in the source-csv (I've keeped the sample-word "TAX" in blue but the 2nd Grep Style will make it invisible), so, sure, totally automatic with 2 grep styles, even if "TAX" is not in some paras!  😉

 

As:

 

 

(^/)