Welcome to the most active Linux Forum on the web.
Go Back > Blogs > HMW
User Name


Rate this Entry

Regex in LibreOffice

Posted 05-24-2016 at 05:06 AM by HMW

Although I prefer to work with text in editors, and not in word processors, I sometimes have to. Today I faced a massive editing task in a formatted .rtf document. I had to iron out some "bugs" in the text. Such as no space after a dot:

Now, going through this massive text and look for these occurances manually clearly wasn't an option. I'd rather eat a cactus. Had it been "normal" - not formatted - text, I could have used regular expressions in Vim, or Sed or whatever tool. But since I could not "un format" the text it was a no-go.

Then I found that you could actually use regular expressions in LibreOffice. The syntax is a little different than in Sed for instance, but the differences are well documented here.

So, instead of doing this in Sed:
's/\.\([A-Z]\)/. \1/'
We do this in LibreOffice:
[Search for] \.([A-Z])
[Replace with] . $1
As you see, not all too different. This (and other) use of regular expressions saved me (and my employer) literally hours of work.

So, thank you LibreOffice, I will be kinder towards you in the future!
Posted in Uncategorized
Views 2422 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 08:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration