Ask Your Question

Using find & replace with search string $ finds paragraph, but using $$ doesn't find an empty paragraph [closed]

asked 2015-10-02 13:24:31 +0200

andylyke gravatar image

updated 2015-10-12 14:03:57 +0200

Alex Kemp gravatar image

I get text from tyros who separate paragraphs using 2 enters, rather than using styles. I'm supposed to format them for publication. Using find & replace with regular expressions active finds a single $, but not two $$. Q: How can I find blank paragraphs?

MS Windows 10 writer

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-15 17:19:56.348745

4 Answers

Sort by » oldest newest most voted

answered 2015-10-05 18:16:44 +0200

Alex Kemp gravatar image

updated 2015-10-09 16:11:55 +0200

LO Writer search/replace is well-nigh useless.

The well-recommended Alternative search-replace extension has not been updated since Jan 21, 2014 & is declared as suitable for lo-4.1. I've no idea how it performs under 5.0.

If you decide to code a macro, the following will help:

These are the Unicode chars used for new line/paragraph/page entry:

  • New Line: (U+000A) LINE FEED (LF)
  • New Paragraph: (U+000D) CARRIAGE RETURN (CR)
  • New Page: (U+000C) FORM FEED (FF)

Entering a LF char ((kbd:):Shift+Enter) will start a newline in the same paragraph (or bullet-point), whilst entering a CR char ((kbd:):Enter) will start a newline but also a new paragraph. Entering a FF char ((kbd:):Ctrl+Enter) will start a newline, new paragraph + new page all at the same time.

Thus, if you write yourself a search/replace macro you will be looking for 2 consecutive CR chars & replacing them with a single CR char.

Have fun!

If this helps then please tick the answer (✔)
...and/or show you like it with an uptick ()

edit flag offensive delete link more

answered 2015-10-30 20:20:31 +0200

w_whalley gravatar image

With Regular expressions checked, search for ^$. Replace with -nothing-.

edit flag offensive delete link more


This works great, thank you!

paravantis gravatar imageparavantis ( 2017-08-05 21:52:41 +0200 )edit

answered 2015-10-30 20:03:28 +0200

col48 gravatar image

Re Alternative search extension: Tentatively (since I have not tried it pre v5.0) it may be OK under LO5.0 (In the last half-hour I thought the opposite!)

  1. I searched for \p (ie para marks) and it found them [but only with Regular Expressions on, which was what I had failed to do before]
  2. I also tried changing all 'it' to 'it', preserving capitalisation - just to see if anything changed - and it worked as expected.
  3. It may have slowed LO down considerably, after doing a substantial replace, but this may be due to other causes.
edit flag offensive delete link more

answered 2015-10-09 15:44:11 +0200

Edward gravatar image is a very nice extension which easily allows searching for double paragraph marks (\p\p) or series of empty paragraphs (^$\p*). It also features a drop down list of regular extensions (and properties) for those of us who don't remember which regular expression to use. I use it (often) with L.O., no personal experience with the new release.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-10-02 13:24:31 +0200

Seen: 673 times

Last updated: Oct 30 '15