How can I insert (or remove) page breaks throughout a document via search and replace?

I have a document that will eventually be 100 pages and there is a unique piece of text at the beginning of each page. I would like to search for that text and replace it with a page break followed by the text. I am generating the document via another program so if I needed to place something that could be completely replaced by a page break I could also do that. The real question is how to put page breaks in the search and replace dialog.

The problem is that page breaks are properties of the first paragraph on a page, so they aren’t accessible for search & replace using regular expressions. In your case, a solution would be to assign a special paragraph style to all those “first paragraphs”. AFAIK you can’t do this using the built-in search and replace, but there’s a LibreOffice Writer extension that allows for this (available for OpenOffice, too). Hope this works for you.

Sorry, but I’m used to stack exchange sites Is there a way to “accept” this answer? I don’t have enough karma to upvote it, or is there something else I should do? The extension worked exactly the way I wanted it to. Fantastic thanks

Happy to hear that the extension solved the problem! - It seems that the askbot software still has some issues yet, i’m missing some features familiar from stackexchange, too…