Skip to main content
Inspiring
September 27, 2022
Question

InDesign GREP help

  • September 27, 2022
  • 1 reply
  • 170 views

Greetings, Can anyone share a GREP expression that will take a block of copy (with paragraph breaks) in InDesign and insert a Page Break after every 8 words?

This topic has been closed for replies.

1 reply

Community Expert
October 1, 2022

This is kinda working for me

 

Find
(?s)((.+?\b)\K){16}

Change to:

~P

 

Reason why I say 'kinda' is when I run the search for Change All - it's taking 1 line and making 9 words.

 

When I just run by Change/Find (individually) it works fine.

 

Weird - I don't know why!

 

I'm sure there's a GREP expert with a far superior method than this, but I am curious as why Change All results in 1 page being 9 words. But Change/Find (individually) works... very odd...