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

Override One GREP Style Instance

Community Beginner ,
Sep 12, 2019 Sep 12, 2019

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!

 

 

3.2K
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 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.

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

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.

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 ,
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.

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

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

 

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

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

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 ,
Sep 12, 2019 Sep 12, 2019
Disabling GREP Style locally won’t help you if you have two instance, one that you want it Italics and one not. 🙂
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 ,
Sep 12, 2019 Sep 12, 2019
At the end, was that .. a smiley? It's gruesome. A square head with crooked teeth.
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
Mentor ,
Sep 12, 2019 Sep 12, 2019
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.
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
New Here ,
Jun 18, 2024 Jun 18, 2024
LATEST

OMG! 😄

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