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

Change style with GREP inside a paragraph style

Community Beginner ,
Jun 09, 2022 Jun 09, 2022

Hello to all

I have a bilingual line in my document, something like

Presentation  |  Apresentacao

Inside a paragraph style, I created a GREP to apply a Character style from the "|" character on.

\x{007C}.+$

How could I changed it to apply this character format only AFTER the "|" character? I don't want include the | in the character style.

 

Thanks in advance

Rita

TOPICS
How to
442
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

correct answers 2 Correct answers

Community Expert , Jun 09, 2022 Jun 09, 2022

It would be easier to use nested styles.

Capture d’écran 2022-06-09 à 23.51.16.jpg

 

Capture d’écran 2022-06-09 à 23.50.41.jpg

Translate
Community Beginner , Jun 09, 2022 Jun 09, 2022

I joined your solution to mine and the following expression worked out:

(?<=\|).+$

Thak you all

Translate
Community Expert ,
Jun 09, 2022 Jun 09, 2022

It would be easier to use nested styles.

Capture d’écran 2022-06-09 à 23.51.16.jpg

 

Capture d’écran 2022-06-09 à 23.50.41.jpg

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 Beginner ,
Jun 09, 2022 Jun 09, 2022

I used nested styles elsewhere, but here, sometimes I have 1 word, sometimes uo to 3 before the |

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 ,
Jun 09, 2022 Jun 09, 2022

It does not matter, the trigger to apply the character style is the |, not a number of words.

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 Beginner ,
Jun 12, 2022 Jun 12, 2022

ok, I see it now. Thank you so much!

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 ,
Jun 09, 2022 Jun 09, 2022

(?<=\|) \w+

This grep will find "1 space" and "word" after "|"

 

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 Beginner ,
Jun 09, 2022 Jun 09, 2022

I joined your solution to mine and the following expression worked out:

(?<=\|).+$

Thak you all

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 ,
Jun 10, 2022 Jun 10, 2022

(?<=\|).+$

This expression will find everything after "|" up to the end of paragraph.

If your situation is just:

English | Spanish^p

your expression works.

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 ,
Jun 12, 2022 Jun 12, 2022
LATEST

Be aware that GREPs make InDesign slower, nested styles are faster.

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