Reply To: Grep query to find start of third sentence, or fourth, or second…?

Home Page / Forums / General InDesign Topics (CLOSED) / Grep query to find start of third sentence, or fourth, or second…? / Reply To: Grep query to find start of third sentence, or fourth, or second…?

#62225
Anonymous
Inactive

Unless someone comes up with something better, I can probably get the following to work for me as long as I use it correctly.

(^.+(?!n)r|^.+n.+r|^.+$)

Finds a sentence with any number of characters, with or without a forced line break, or if it finishes at the end of a paragraph. That expression is then duplicated five times:

(^.+(?!n)r|^.+n.+r|^.+$)(^.+(?!n)r|^.+n.+r|^.+$)(^.+(?!n)r|^.+n.+r|^.+$)(^.+(?!n)r|^.+n.+r|^.+$)(^.+(?!n)r|^.+n.+r|^.+$)

In the replace field I put ~c in-between the sentence I want my icon to be pasted (spaces only included to make it easier to see).

For example:

$1$2$3 ~c $4$5

The icon (or rather, the contents of the clipboard) will go before sentence 4.

This article was last modified on May 21, 2012

Comments (0)

Loading comments...