Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Bold GREP Style if Colon is Present Excluding URL

Return to Member Forum

  • Author
    Posts
    • #14389342
      Marc Dunker
      Member

      I’m looking for a GREP string in a Paragraph Style that will make the copy bold at the beginning of a paragraph (^.+?\:) to the first colon if present.

      The style works fine for most paragraphs except for ones that include a URL that includes “https:” in the copy.

      What string can I do to make this happen? I’ve tried embedding a negative lookahead in a positive lookbehind ^(?<=.+(?!https)): (not sure if that can work), lookarounds, etc. I don’t want these paragraphs to have bold at all. There’s a separate style working that changes the copy color and adds an underline to the URL.

    • #14389344
      Marc Dunker
      Member

      I think ^.+?(?<!https)\: solves my problem. Sometimes it seems the simpler strings are what works!

    • #14389356
      David Blatner
      Keymaster

      Interesting problem… normally, I would recommend using a Nested Style instead of a grep style for a run-in head like this. But the fact that sometimes there are URLs definitely makes it harder.

      But for anyone reading this who is curious, here’s the nested style approach:

      InDesign How-to Video: How to Automate Run-in Header Styles

      • #14389811
        Marc Dunker
        Member

        I normally gravitate toward GREP instead of a nested style perhaps due to design style/projects I’ve worked on. Often it’s a body text that may or may not need the run-in head.

        With a nested style, every paragraph needs the colon format or the entire paragraph will be whatever character style the nested style defines. As you know, I’m able to apply a style with GREP to find specific text patterns.

    • #14389812
      Peter Kahrel
      Participant

      This one seems to work: ^.+(?<!https):

Viewing 3 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads