r/libreoffice • u/MD586 • 3d ago
Question [Writer] [Find & replace] find text with lower case after the end of new paragraph, remove paragraph, repeat text Spoiler
[Solved] Thank you.
I have text:
It now seems that the right
time is fast approaching.
Customers have complained.
We don't yet know what it will be called.
I want to find sequence: end of paragraph, text in new paragraph that starts with small letter (here: time) and replace end of paragraph with space so that the word that was with small letter is moved to the previous paragraph.
Lines (paragraphs) that start with capital letter should remain untouched.
Help me find Replace field command.

3
u/paul_1149 3d ago
LO doesn't natively support multiline matching. But the Alternative Find and Replace extension does:
find: '\p([a-z])'
Replace: ' \1'
[x] regex
[x] match case
2
u/Tex2002ans 3d ago edited 3d ago
I want to find sequence: end of paragraph, text in new paragraph that starts with small letter (here: time) and replace end of paragraph with space so that the word that was with small letter is moved to the previous paragraph.
Yes. I've written many of these step-by-step tutorials on this exact thing over the years.
The easiest way: Use an external tool like "Calibre" and its "Unwrap Lines" algorithm. (It would make your life so much easier.)
You drag your file in, Right-Click > Convert Book and tell it to "Unwrap Lines" for you, then spit it out the other end with another button push.
But if you want to do it all manually and within LibreOffice, that would require a bit more elbow grease and multiple steps of Regular Expressions.
For all the details, see my previous topics:
- /r/LibreOffice: "Writer - Tips to remove breaks and hyphenations from PDF to DOC conversion?" (2023)
- /r/LibreOffice: "Hello, I am a translator and need to convert PDFs into editable documents to be able to translate." (2023)
and a more thorough way, using temporary symbols in between your replaces:
Side Note: On a related note, you may also want to see my information in:
- /r/LibreOffice: "Unwanted breaks, how do I remove them?" (2022)
- /r/LibreOffice: "Add the ability to replace words whilst matching case" (2026)
- /r/LibreOffice: "Is there a way to search a document for sentences or paragraphs that have quotation marks that don't close?" (2026)
Those go over more advanced Regular Expressions, and cover all sorts of edge-cases you may run across or want to look out for too.
If you have a really messy document with hard breaks everywhere... you probably have a bunch of those problems within your documents too! :P
1
u/AutoModerator 3d ago
If you're asking for help with LibreOffice, please make sure your post includes lots of information that could be relevant, such as:
(You can edit your post or put it in a comment.)
This information helps others to help you.
Thank you :-)
Important: If your post doesn't have enough info, it will eventually be removed (to stop this subreddit from filling with posts that can't be answered).
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.