Skip to main content
Participant
October 15, 2019
Question

GREP to style text after right indent

  • October 15, 2019
  • 2 replies
  • 1150 views

Hello, I'm still learning about using GREP styling in InDesign and have gotten stuck with this one. Within my paragraph style I'd like GREP to find a right indent and then style the text after it (which could be two words or 10+), until a paragraph break.

 

I tried this: (?<=~y)[\l\u]+

But it only styles one word after my right indent.

I thought if I used another positive lookbehind in relation to a paragraph break, that would help, but this isn't right either:

(?<=~y)[\l\u]+(?<=$)

 

Any help would be appreciated!

This topic has been closed for replies.

2 replies

Toques
Participating Frequently
October 20, 2019

If you're content is really predictable, you could go greedy and capture everything between a right indent tab and the paragraph break itself.

It's just ~y.+$

Not elegant by any stretch, but this gets the job done.

Participant
October 23, 2019

Oh that makes sense because it is very straight forward and predictable. Thank you!

xxxxxxxxxxxxxxxxxxxxyyyy
Participating Frequently
October 16, 2019

Hi,

the GREP styles each letter after the right indent until a space character occurs. So only the first word after the intent will by styled.

You can try adding a space character in the search

(?<=~y)[\l|\u| ]+

or search for every character

(?<=~y).+

 

Regards

Participant
October 23, 2019

(?<=~y).+

Did the trick!

Thank you!