Reply To: GREP style that selects the last instance in a paragraph

Home Page / Forums / General InDesign Topics (CLOSED) / GREP style that selects the last instance in a paragraph / Reply To: GREP style that selects the last instance in a paragraph

#14347056
Nick B
Participant

You already have your answer on how to achieve the selection, but in case you wanted to know why your original suggestion didn’t work, the “.+” will include any intervening opening or closing parentheses, so it:

– finds the first “(”
– matches “.+” (including any parentheses)
– matches the “)” at the end per the rule

If there was no closing parenthesis then obviously even though it matched the first two parts, the expression would return nothing. So as others have pointed out, you just have to make sure the middle rule is matching what you want, i.e. no opening parentheses, in which case when it finds the first “(” it will not match the expression but when it gets to the last “(” it will.

This article was last modified on September 9, 2021

Comments (0)

Loading comments...