Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help with grep

Contributor ,
Sep 01, 2025 Sep 01, 2025

I asked in another post about uncompiling a binary javascript and was informed not to go down that path...

OK. I accept that. I have found a way to add the fuctionality that i need. I think using grep. But i know more about Quantem mechanics than i know about GREP so i am going to need help here also.

here it is:

Search for any text formatted with par style "sty1". this string we will call (for now) "txt1"

replace that string with "I love to eat" && txt1

Format that entire string with par style "sty2"

Format the last word of the new string as bold.

 

Can this be done?

 

I am so appreciative to those who help me here!

 

SF

TOPICS
How to , Type
147
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2025 Sep 02, 2025

Can be done, do you want to do this via script or via the UI interface?

I have a few questions. What would be the final text?

"I love to eat" && txt1

Do you mean that we use && and then the text that was searched intially? So would that mean applying the bold character style to the intial search string, i.e. txt1

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 02, 2025 Sep 02, 2025

I was using those symbols from my Pascal days. So if it found "walnuts" it would replace it with "I love to eat wallnuts" and then formatting "walnuts" as bold. Sorry for the confussion.

If a script could do this all in one shot, that would be the best way, right?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2025 Sep 02, 2025

I tried doing it via Grep searc/replace directly. I also added a grep style to "sty2" to apply a character style named Bold to the last word. See the screenshots below. If this works for you we won't need the script

Screenshot 2025-09-02 at 1.09.18 PM.pngScreenshot 2025-09-02 at 1.09.09 PM.png

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2025 Sep 04, 2025
LATEST

@SuzzyFlamingo did the above work?

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines