Skip to main content
Inspiring
June 9, 2022
Answered

Change style with GREP inside a paragraph style

  • June 9, 2022
  • 2 replies
  • 602 views

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

This topic has been closed for replies.
Correct answer Rita247900390kon

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

(?<=\|).+$

Thak you all

2 replies

Community Expert
June 9, 2022

(?<=\|) \w+

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

 

Rita247900390konAuthorCorrect answer
Inspiring
June 9, 2022

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

(?<=\|).+$

Thak you all

Community Expert
June 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.

jmlevy
Community Expert
Community Expert
June 9, 2022

It would be easier to use nested styles.

 

Inspiring
June 9, 2022

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

jmlevy
Community Expert
Community Expert
June 10, 2022

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