Skip to main content
SuzzyFlamingo
Inspiring
Sep 7, 2025 4:36 AM UTC
Answered

Help w/grep

Hi friends!

I need to format, within a par style ANY TEXT STRING that has before it - colon and space, and after it a period. So this would be -

 

Yesterday it was: very hot outside. And we stayed inside

So the words "very hot outside." (Including the period but to the colon) get formatted with their own char style.

 

Little by little I will hopefully understand how to do this ...

Thanks

SF

Manan JoshiCorrect answer
Community Expert
Sep 7, 2025 6:04 AM UTC

Yes that makes sense. If the operation that you want to do is apply style on the found string then grep style would work fine.

-Manan

-Manan

3 replies

Community Expert
Sep 7, 2025 5:03 AM UTC

Use the following grep in find what

(?<=:) [^.\r]+\.

And in the change format select the character style you want to apply

-Manan

Translate
-Manan
SuzzyFlamingo
Inspiring
Sep 7, 2025 5:57 AM UTC

Thank you for your attention and reply!

Excuse my ignorance, but can I use this as a nested grep style within a paragraph style to automatically format that string? I mean it is all over my paragraphs, and i would like it to happen in real time.?

edit:

I tried and it worked. So I guess we now know that any grep working in find will also work in a grepped style, right?

 

Translate
Manan JoshiCommunity ExpertCorrect answer
Community Expert
Sep 7, 2025 6:04 AM UTC

Yes that makes sense. If the operation that you want to do is apply style on the found string then grep style would work fine.

-Manan

Translate
-Manan