19 Replies Latest reply on Apr 10, 2014 4:04 PM by Obi-wan Kenobi

    Apply GREP style except in certain cases

    FishFred

      Hi Guys!

       

      I've been scratching my head for a couple of days, so I'm finally resorting to you!

       

      BACKGROUND

      I am creating a template for my thesis, and I want to highlight things I know I don't like and that I'd like to fix. So I created a character style "highlight" that I use in my GREPs.

       

      GOAL

      I want to highlight hyphens that are between two numbers, such as 2000-2010, because I want to have an en dash instead. This is simple enough: \d-\d

      Booyah

       

      ISSUE

      The problem is that I have URLs in my text, and I don't want to highlight anything in URLs. They are what they are.

       

      QUESTION

      Is there a way to say "highlight sandwiched hyphens, except if they belong to a URL"? I tried several options, but none of them worked...

       

      Thank you!!

       

      Fred

       

      (ps: I'd rather not use a find and replace script here, as I want to make sure I REALLY want to fix the highlighted characters)