Bug 153212 - "regular expression in the Replace box" makes no sense
Summary: "regular expression in the Replace box" makes no sense
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: fpy
URL: https://ask.libreoffice.org/t/41709/
Whiteboard: target:24.8.0
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-26 08:36 UTC by Mike Kaganski
Modified: 2024-03-11 22:55 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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