Skip to main content
oksananka
Participating Frequently
July 24, 2017
Answered

What is GREP for words with apostrophe within single quotation marks?

  • July 24, 2017
  • 3 replies
  • 1586 views

Hello dear InDesign community.

Help me please to edit my GREP code to make text italic within single quotation marks with words that contains apostrophe. I have a problem that it stops working on the first apostrophe in a sentence. GREP sees it as the right quotation mark.
My GREP now is: ~[(.*?)~]

Thanks a lot.

Oksana

[Moved from the Lounge (which is where you can "connect with your peers" from across all of Adobe's products for conversations that don't directly relate to help and support) to a product-specific support forum by a moderator.]

    This topic has been closed for replies.
    Correct answer Erica Gamet

    I did

    ~[(.+?)~](?!\l)

    and replaced with $1 (assuming you want to remove the quotes, of course...and maybe italicize them.

    3 replies

    Erica Gamet
    Inspiring
    July 24, 2017

    Erica Gamet
    Erica GametCorrect answer
    Inspiring
    July 24, 2017

    I did

    ~[(.+?)~](?!\l)

    and replaced with $1 (assuming you want to remove the quotes, of course...and maybe italicize them.

    oksananka
    oksanankaAuthor
    Participating Frequently
    July 25, 2017

    Dear Erica, thanks a lot.

    It works perfectly.

    Erica Gamet
    Inspiring
    July 25, 2017

    Excellent!

    Erica Gamet
    Inspiring
    July 24, 2017

    Maybe try a negative lookahead and see when it is NOT followed by a lower case character? Because a closing single quote would be followed by a space, whereas an apostrophe would be followed by a lower case character (I would think).