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

GREP style doesn't work, Find/Change GREP does

New Here ,
Apr 21, 2017 Apr 21, 2017

Copy link to clipboard

Copied

I have a paragraph style with a GREP style inside that renders the first three words after the name (first paragraph) in small caps:

(?<=\r~h)\w+\s\w+\s\w+

The “name” grep style also doesn't work btw, but let me focus on “small caps” for now. The thing is, the exact same Find/Change GREP query works just fine and returns exactly what I'm looking for. However, when in a style, it doesn't seem to work at all. Moreover, I went as far as creating a new document with a text frame with placeholder text and making a paragraph style with just the GREP and nothing else to make sure I'm not missing something the stacked up during the style build-up and it had no effect. Even tried it on different versions of InDesign.

Screen Shot 2017-04-21 at 12.51.47.png

Views

1.0K

Translate

Translate

Report

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 1 Correct answer

Community Expert , Apr 21, 2017 Apr 21, 2017

GREP styles cannot look "outside" of the single paragraph that they are defined "in". That means, in practice, you cannot use anything with "\r".

Use the common markers "^" and "$" for 'start of paragraph' and 'end of paragraph' instead. These do work in a GREP style because they do not explicitly test for presence of "\r" or its cousin "~h".

Votes

Translate

Translate
Mentor ,
Apr 21, 2017 Apr 21, 2017

Copy link to clipboard

Copied

What if you try \r~h\K instead of (?<=\r~h) ?

(for CS6 and later)

Votes

Translate

Translate

Report

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 ,
Apr 21, 2017 Apr 21, 2017

Copy link to clipboard

Copied

GREP styles cannot look "outside" of the single paragraph that they are defined "in". That means, in practice, you cannot use anything with "\r".

Use the common markers "^" and "$" for 'start of paragraph' and 'end of paragraph' instead. These do work in a GREP style because they do not explicitly test for presence of "\r" or its cousin "~h".

Votes

Translate

Translate

Report

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
Advisor ,
Apr 21, 2017 Apr 21, 2017

Copy link to clipboard

Copied

LATEST

^^ Correct answer ^^

As far as I'm concerned anyway.

Votes

Translate

Translate

Report

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