clarify match/replace. tdf#153212
Change-Id: I019014574dc1fda4850363aecb70d083a89c0fec
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/164678
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
diff --git a/source/text/shared/01/02100001.xhp b/source/text/shared/01/02100001.xhp
index e96b985..33925f2 100644
--- a/source/text/shared/01/02100001.xhp
+++ b/source/text/shared/01/02100001.xhp
@@ -250,14 +250,14 @@
<paragraph id="par_id871559576709007" role="listitem">To enclose a set of ‘|’ alternatives. For example, the regular expression "b(oo|ac)k" matches both "book" and "back".</paragraph>
</listitem>
<listitem>
<paragraph id="par_id891559576747109" role="listitem">To group terms in a complex expression to be operated on by the post-fix operators: "*", "+" and "?" along with the post-fix repetition operators. For example, the regular expression "a(bc)?d" matches both "ad" and "abcd" in a search.; the regular expression "M(iss){2}ippi" matches "Mississippi".</paragraph>
<paragraph id="par_id891559576747109" role="listitem">To group terms in a complex expression to be operated on by the post-fix operators: "*", "+" and "?" along with the post-fix repetition operators. For example, the regular expression "a(bc)?d" matches both "ad" and "abcd"; "M(iss){2}ippi" matches "Mississippi".</paragraph>
</listitem>
<listitem>
<paragraph id="par_id801559576780692" role="listitem">To record the matched sub string inside the parentheses as a reference for later use in the <widget>Find</widget> box using the "\n" construct or in the <widget>Replace</widget> box using the "$n" construct. The reference to the first match is represented by "\1" in the <widget>Find</widget> box and by "$1" in the <widget>Replace</widget> box. The reference to the second matched sub string by "\2" and "$2" respectively, and so on.</paragraph>
<paragraph id="par_id801559576780692" role="listitem">To reference the matched sub string inside the parentheses for later use. The "\N" construct is used in the <widget>Find</widget> box, the "$N" construct is used in the <widget>Replace</widget> box. "N" being a digit, the reference to the first match is represented by "\1" in the <widget>Find</widget> box and by "$1" in the <widget>Replace</widget> box; "\2" and "$2" reference to the second matched, and so on.</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="par_id951559576846997">For example, the regular expression "(890)7\1\1" matches "8907890890".</paragraph>
<paragraph role="paragraph" id="par_id561559576865734">With the regular expression "\b(fruit|truth)\b" in the Find box and the regular expression "$1ful" in the Replace box occurrences of the words "fruit" and "truth" can be replaced with the words "fruitful" and "truthful" respectively without affecting the words "fruitfully" and "truthfully"</paragraph>
<paragraph role="paragraph" id="par_id951559576846997">For example, the regular expression "(890)xy\1z\1" matches "890xy890z890".</paragraph>
<paragraph role="paragraph" id="par_id561559576865734">With the regular expression "(fruit|truth)\b" in the Find box, and the replacement expression "$1ful" in the Replace box, occurrences of "fruit" and "truth" are replaced with "fruitful" and "truthful" respectively. Note: "\b" prevents "fruitfully" or "truthfully" from matching.</paragraph>
</tablecell>
</tablerow>
<tablerow>