Convert new line to empty paragraph

Hello.

I use this regex:

\n (In Find field)
^$ (in Replace field)

but dose not convert new line to empty paragraph and convert to ^$

I attached screenshots and Example file.
00

Example.odt (10.3 KB)

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: 50(Build:3)
CPU threads: 2; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.5.0~rc3-0ubuntu0.22.04.1~lo1
Calc: threaded

List of Regular Expressions

3 Likes

The common misconception is that replace string is a “regular expression” (and thus, one can use regular expression syntax there).
No. Regular expressions are rules to match parts of given text. The ^$ is three conditions: “start of the match must be in the beginning”, “end of the match must be in the end”, and “there is nothing between the beginning and the end”. And there is nothing in regex that requires that “beginning” or “end” is a “paragraph mark”. Using conditions and “match rules” in replacement makes no sense. Replacement strings have their own syntax, where some things may refer to regex parts.

1 Like

Hi, enter \n in both the Find and Replace fields, and it should work.

2 Likes

LibreOffice 7.5 Help

2 Likes