Description: When the "\n" (without quotes) escape character is used in the search and/or search/replace dialogs it does not find the next paragraph's end. Steps to Reproduce: 1.Open a document with several paragraphs in it 2.Open Find (Ctrl-F) or Search/Replace (Ctrl-H) 3.Enter "\n" (without quotes) to search for a paragraph end 4.Press the "Find" button Actual Results: The Search and Replace dialog gives an error stating: "Search key not found" Expected Results: The search should find the next \n (i.e. paragraph end) character after the cursor position. Reproducible: Always User Profile Reset: Yes Additional Info: Version: 7.0.6.2 (x64) Build ID: 144abb84a525d8e30c9dbbefa69cbbf2d8d4ae3b CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: en-US (en_US); UI: en-US Calc: threaded
> When the "\n" (without quotes) escape character is used in the search and/or > search/replace dialogs it does not find the next paragraph's end. And it should not. As described on the "List of Regular Expressions" help page [1], \n in the "Find" box matches *line break that was inserted with the Shift+Enter key combination*. By the way, it (and any other regular expressions) only work when relevant option is selected in the dialog/toolbar. To search for paragraph end, use $ as the search term (again, using regular expressions). [1] https://help.libreoffice.org/latest/en-US/text/shared/01/02100001.html
Yes, thank you. I tried using the $ too but it does not work. I have a document that has 2 empty paragraphs together after a full one for example (I am representing the paragraph marking with (\n)): This is the full paragraph (\n) (\n) (\n) When I do a search/replace entering in the search box: $$$ And putting in the replace box: \n\n I would expect to see the result as follows: This is the full paragraph (\n) (\n) This means eliminating one of the "paragraph end" markings, however, it does not work either using the \n\n\n in the search or using the $$$. It states that it does not find it.
(In reply to Federico Atristain from comment #2) This is because in LibreOffice, search is always *inside* a single paragraph. However, there is a way to search for an *empty* paragraph (also mentioned on the help page): ^$ Finds an empty paragraph. However, for many advanced find/replace actions, you might want to use an extension: https://extensions.libreoffice.org/en/extensions/show/alternative-dialog-find-replace-for-writer