Bug 38551 - Find hard carriage return using regular expressions "$" does not work backwards
Summary: Find hard carriage return using regular expressions "$" does not work backwards
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.3.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Find&Replace-Regex
  Show dependency treegraph
Reported: 2011-06-22 00:49 UTC by Lance Haverkamp
Modified: 2023-01-23 13:50 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

Example ODT to test (9.16 KB, application/vnd.oasis.opendocument.text)
2023-01-23 09:27 UTC, Stéphane Guillou (stragu)

Note You need to log in before you can comment on or make changes to this bug.
Description Lance Haverkamp 2011-06-22 00:49:58 UTC
Find hard carriage return with the Find/Replace tool does not work.

This used to work in at least some older versions of OOo.  
Check regular expressions, enter $ or \N, no results are ever found.

Soft carriage returns (\n) *are* found, just not hard ones.

Comment 1 Yifan Jiang 2011-06-22 02:06:34 UTC
Platform: SLED 11 sp1 i586
build info: Libreoffice 3.4 release

The $ and \n works properly for 3.4 build.
Comment 2 Lance Haverkamp 2011-06-22 08:55:07 UTC
Thanks for the info Yifan,

Somewhat confirmed...It now works going forwards.  Now, I'm not sure if anyone would ever *want* to find/replace $ going backwards, but that currently does not work.

Comment 3 Lance Haverkamp 2011-06-22 09:06:42 UTC
Stripping-out multiple carriage returns also fails:

Finding ${2,8} returns nothing
Comment 4 Björn Michaelsen 2011-12-23 12:29:06 UTC Comment hidden (obsolete)
Comment 5 Florian Reisinger 2012-08-14 14:04:21 UTC Comment hidden (obsolete)
Comment 6 Florian Reisinger 2012-08-14 14:05:12 UTC Comment hidden (obsolete)
Comment 7 Florian Reisinger 2012-08-14 14:09:39 UTC Comment hidden (obsolete)
Comment 8 Florian Reisinger 2012-08-14 14:11:38 UTC Comment hidden (obsolete)
Comment 9 sasha.libreoffice 2012-09-19 13:49:50 UTC
In 3.6.1 on Fedora 64 bit:
search with $ works correctly, replacing - not. For example enter one line of text, several empty lines, another line. Then replace all occurrences of $ to empty line. Appears two lines in result, but should be one.

search with ${2,8} not works. And $* not works
Comment 10 QA Administrators 2015-01-05 17:52:26 UTC Comment hidden (obsolete)
Comment 11 Lance Haverkamp 2015-01-05 20:49:54 UTC
It is still impossible to search & replace multiple hard carriage returns (blank lines)  Search for ^$^$ returns zero results; I believe OOo used to search for this using \N\N  which also does not work in LibreOffice.

Now using Version: on Xunubtu.
Comment 12 MarjaE 2015-09-25 21:47:58 UTC
Persists in I'm not familiar with the substitute searches and haven't been able to test them.
Comment 13 QA Administrators 2016-11-08 10:35:30 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2019-12-03 13:57:29 UTC Comment hidden (obsolete)
Comment 15 Safeer Pasha 2021-03-02 14:34:52 UTC
still NOT solved

Version: / LibreOffice Community
Build ID: 10(Build:3)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 16 Stéphane Guillou (stragu) 2023-01-23 09:26:49 UTC
"\N" does not work, but I don't believe it is supposed to work as it is not documented by our help page[1] and not by the full ICU Regular Expressions documentation either[2], which we are supposed to support.

Finding a hard carriage return works with "$", but only going forward in the text. So I am focusing this bug report in this particular problem.

The issue with replacing is likely covered in bug 135538.

Other issues can be described in another bug report, if a search of existing bugs doesn't return anything equivalent. Keeping bug reports focused will help getting the issues resolved.

[1] https://help.libreoffice.org/7.6/en-US/text/shared/01/02100001.html
[2] https://unicode-org.github.io/icu/userguide/strings/regexp.html#regular-expression-metacharacters

Version tested:

Version: (X86_64) / LibreOffice Community
Build ID: 579d144290c1617fdb38d09b30900a6bbe390b8d
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 17 Stéphane Guillou (stragu) 2023-01-23 09:27:14 UTC
Created attachment 184836 [details]
Example ODT to test