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

Override One GREP Style Instance

Community Beginner ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

Hello, is there a way to cancel one instance of an active GREP style?

For example, I have a GREP style to italicize our company name every time it appears, but in one instance, we do not want it italicized. Is there a way to manually override that one instance while keeping the other instances live?

Thanks!

 

 

Views

2.3K

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 , Sep 12, 2019 Sep 12, 2019

Create a new paragraph style that does not contain the GREP style, and apply it to the paragraph containing that one instance.

Votes

Translate

Translate
Community Expert ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

There could be other ways, but one way I've applied such an exception is to make a copy of the Paragraph style, delete the GREP style from it, and apply it to just that one paragraph.

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 ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

Create a new paragraph style that does not contain the GREP style, and apply it to the paragraph containing that one instance.

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 ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

In your GREP style query, you could add a Negative LookBehind for a Non-joiner characters and manually enter the non-joiner before the italics text in the paragraph when you want to disengage it. 

 

 

(?<!~j)yourgrepquery

 

 

image.png

 

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 Beginner ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

Thanks Jean! I see what you're saying but can you elaborate a little more. Would adding the non-joiner remove the italics on that word?

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 ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

Yes. Since you will be asking to make it Italic *only* when there is no Non-joiner before. I have add a picture on my original reply. You can see one my name is not italic because the non-joiner are present before.

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 Beginner ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

Thank you!! Based on your suggestion, I created a second GREP style that said "if there's a non-joiner before this word, apply the 'Regular' character style." It worked!

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 ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

That will apply "Regular" even when in a bold heading. You don't need a second GREP. Use Jean-Claude's (clever!) and it'll not get applied when there is a non-joiner, period.

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
Mentor ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

There's a simpler way, imo.

Strictly speaking, you can’t disable GREP for just one instance, but you can do this for a paragraph, without creating yet another style.
Put your text cursor in a paragraph which contains your word(s), go to ‘hamburger’ menu at the very right corner of Control panel (right after Quick Apply), select GREP Styles…, delete or disable the query you don’t want to be applied to that paragraph. Done.
Note: plus sign appears next to your para style name, showing there is an override.

disablegrep.png

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 ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

Disabling GREP Style locally won’t help you if you have two instance, one that you want it Italics and one not. 🙂

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 ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

At the end, was that .. a smiley? It's gruesome. A square head with crooked teeth.

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
Mentor ,
Sep 12, 2019 Sep 12, 2019

Copy link to clipboard

Copied

As I said - it's for whole paragraph. Some other suggestions here are about the same. For example, creating another para style. It's not clear from OP's query. IF you have only one instance, no need to make it more complex than it is. Anyway, always is good to know more than one way.

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
New Here ,
Jun 18, 2024 Jun 18, 2024

Copy link to clipboard

Copied

LATEST

OMG! 😄

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