Skip to main content
cathiep81049532
Participant
September 12, 2019
Answered

Override One GREP Style Instance

  • September 12, 2019
  • 4 replies
  • 3494 views

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!

 

 

    This topic has been closed for replies.
    Correct answer SJRiegel

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

    4 replies

    winterm
    Legend
    September 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.

    jctremblay
    Community Expert
    Community Expert
    September 12, 2019
    Disabling GREP Style locally won’t help you if you have two instance, one that you want it Italics and one not. 🙂
    Jongware
    Community Expert
    Community Expert
    September 12, 2019
    At the end, was that .. a smiley? It's gruesome. A square head with crooked teeth.
    jctremblay
    Community Expert
    Community Expert
    September 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

     

     

     

    cathiep81049532
    Participant
    September 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?
    jctremblay
    Community Expert
    Community Expert
    September 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.
    SJRiegelCorrect answer
    Legend
    September 12, 2019

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

    John Mensinger
    Community Expert
    Community Expert
    September 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.