Bug 153212

Summary: "regular expression in the Replace box" makes no sense
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: DocumentationAssignee: fpy
Status: RESOLVED FIXED    
Severity: normal CC: erack, olivier.hallot, stephane.guillou
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
URL: https://ask.libreoffice.org/t/41709/
Whiteboard: target:24.8.0
Crash report or crash signature: Regression By:

Description Mike Kaganski 2023-01-26 08:36:01 UTC
https://help.libreoffice.org/7.5/ro/text/shared/01/02100001.html has this phrase:

> regular expression "$1ful" in the Replace box

This phrase makes *absolutely* no sense, and is creating additional confusion. By definition, *regular expressions* are *matching* patterns, which are used when *searching*. There is a related replacement string syntax, but replacement strings are *not* regular expressions, and their syntax is necessarily different from regular expression syntax.

Users tend to expect that *regular expression syntax* would work in replacement field; and this incorrect phrase reinforces this misconception. It should be changed to something like simple

> "$1ful" in the Replace box

Additionally, it would make sense to separate *all* the discussion of what is legal in replacement to a separate table (including, e.g., related pieces of \n and \t), to emphasize that they have *different* syntaxes.
Comment 1 Stéphane Guillou (stragu) 2023-01-26 09:41:47 UTC
Agreed, this needs correcting and clarifying in a separate section.
The linked ICU documentation uses the terms "capturing parentheses", "capture-group" and "captured data", but we don't use the term "captur*" at all in our docs.

ICU doc words it as:

> "Capturing parentheses. Range of input that matched the parenthesized subexpression is available after the match."

and:

> "The replacement text for find-and-replace operations may contain references to capture-group text from the find."
Comment 2 Commit Notification 2024-03-11 22:48:39 UTC
Pierre F committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/3a192b621db3644d50544a64f56ac34909711f92

clarify match/replace. tdf#153212