14 Replies Latest reply on Feb 13, 2013 5:46 AM by MadMac55

    GREP: How to target one occurrence at end of paragraph?

    gfrederickk

      GREP newbie here. Trying to write a GREP expression that will target a photo credit at the end of a photo caption and apply a character style.

       

      Example text:

       

      This is the caption for a photo and there is some more caption here (at left). This is the caption for a photo and there is some more caption here. (AP Photo/John Smith)

       

      The GREP expression needs to target the credit type inside -- and including -- the parenthesis. The trick: The expression needs to target only a single occurrence at the end of the paragraph.

       

      Suggestions? This is what I have, which isn't working. The expression applies the style to every occurrence of type within parenthasis:

       

      \s\(.+\)$

       

      Any help appreciated.