24 Replies Latest reply on Jan 17, 2017 9:32 AM by Obi-wan Kenobi

    How to combine shortest match with location, using GREP styles?




      This question is probably easy for those more experienced, but I'm having problem to make it work. I want to apply a GREP style to some text between parentheses, but not to all of them, only in a certain location (in my case, just when the parentheses are at the end of the paragraph).


      I started with this, and it worked well, selecting all texts between parentheses:



      Then, I thought that inserting a $ at the end of my expression, it would  select just the cases when the parentheses ocurred at the end of the paragraph. But it didn't work, and the selection came back to the "greedy" mode, as seen in the picture:



      It worked in the second paragraph, in which we have just on occasion of parentheses, and they are at the end. But in the first paragraph, I want the GREP to be applied just  in (nsdvnsvk). How can I have the expected result?