Reply To: Indesign GREP to find question phrases

#89900
Aaron Troia
Participant

David is on the right track, I would do it a little differently with a positive lookbehind or a Keep (\K) to look for (but not capture) the punctuation and space before, such as:

(?<=\. ).+?\?
or
\. \K.+?\?

they both do the same thing, just in a different way. They both look for a period space (both zero width so as not to be included or affected in your replace) on one end and a question mark on the other end, and, of course, everything in between.

you can either then group the .+? like (.+?) as a capture group or if you can just use it as is and in your replace field use $0 which basically matches everything that was found.

Let me know if you have any questions.

Aaron

This article was last modified on November 18, 2016

Comments (0)

Loading comments...