2 Replies Latest reply on Jun 29, 2017 2:34 AM by Avant que l'ombre...

    ☺ Just another GREP question

    Avant que l'ombre...

      Hello,

       

      Question 1

      I want to create a GREP rule for formatting words and chains of words that start with the same word, and have dots and space !

       

      Please...

      [Please dot dot dot]

      and

      Please... Let Me Go

      [Please dot dot dot space Let Me Go]

       

      I have tried this formula :

      Please\.\.\.|Please\.\.\. Let Me Go

       

      but it doesn't work the "Let Me Go" is not detected by my GREP rule.

       

      ---

      Question 2 (Homonyms problem)

      Once the GREP formatting has been applied, is it possible to exclude a word from the GREP formatting ?

      (...with a magic trick !)

       

      Example : Let's say I am writing an essay about The Beatles, and I have made a GREP rule for all the songs titles.

      My problem is that some titles are very common words in English :

      Because

      Boys

      Girl

      Goodbye

      I will

      Shout

      Wait

      Yesterday

      Woman

       

      ...words that I will also use many times in my essay. Any ideas ?

       

      Thank you very much

       

       

       

       

       

        • 1. Re: ☺ Just another GREP question
          [Jongware] Most Valuable Participant

          1. It's because the first GREP half already matches, so why would the computer search again? Make the second part optional – GREP is greedy by default, and so it will match the entire string if possible:

           

          Please\.\.\.( Let Me Go)?

           

          (Also, consider using a proper ellipsis instead of dot-dot-dot. Available in most fonts ... and usually drawn nicer than three regular dots … [it may or may not be visible but the first ellipsis in that sentence is 3 full stops, the second one is a “proper” ellipsis]. There is a default hotkey to enter them – Alt+; – and its associated GREP code is ~e.)

           

          2. You can stack GREP styles, as the lower ones will override those higher up, and you can also manually override your formatting. Please reconsider doing it this way. You are probably far better off with creating a separate character style for "Song title", and applying it manually where needed only.

          • 2. Re: ☺ Just another GREP question
            Avant que l'ombre... Level 1

            Thank you for your quick reply , you're a lifesaver.

             

            I think that formatting the words only at the beginning of paragraphs will do the job :

            ^Please\.\.\.( Let Me Go| Do No Touch)?