2 Replies Latest reply on Oct 11, 2011 3:12 PM by BrennanW

    GREP question: How to make \r and \z play along?

    BrennanW Level 1

      Indesign CS5

       

      I have a couple of GREP styles set up to make the laying out of large chunks of text much easier. To reduce time going back over and force returning things, I set up a no-break character style to be applied to words at the end of a paragraph and after punctuation. To get rid of massive gaps at the end of lines, I limited the character count in the words, and whenenver some still get through, I apply a separate "Remove NoBreak" character style. This has made it easier for our web department when converting files as well, due to the lack of forced returns and the addition of no-break formatting in its place.

       

      So far I have 3 GREP queries to apply:

       

      \<\w{1,7}\>\s\<\w{1,8}\>[.!?,:;"]\r

       

      \<\w{1,7}\>\s\<\w{1,8}\>[.!?,:;"]\z

       

      (?<=[.!?;:,"]\s)\<\w{1,7}\>\s\<\w{1,7}\>

       

       

      The reason for the 3 is because the end of paragraph query (\r) won't apply at the end of a story (\z). I have tried combining the two using "|" between the queries but it just ends up not working at all. Neither does grouping the ends like so: (\r|\z)

       

      Is there a way to get this consolidated to a better query, so I don't need to copy and paste the three every time I want to apply it to a style? It would be easier when giving the query to people, too, if it were consolidated. Even all 3 together would be ideal.

       

      Thanks to anyone who can give a hand.