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

#14347054
Dhafir Photo
Participant

Hello! Your regex finds set of parentheses only in the end of paragraph, but my regex finds find the last set in anywhere

\([^)]+\)$
\( open parentheses
[^)] any character except the close parentheses (this form is called negated character set)
+ one time and more (but you should use here +? to make it shortest match)
\) close parentheses
$ end of paragraph

.*\K\(.+?\)
. any character
* zero or more times
\K keep all the before outside the matching
\(.+?\) the same above

This article was last modified on September 9, 2021

Comments (0)

Loading comments...