From 7fa50f5c2f7280129f856f3f9fab85ac047a3e2c Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 21 Nov 2022 14:32:42 +0100 Subject: Regex: precede every metacharacter or operator with "\" ... not every character. Change-Id: I2c09f164c8b48c5ac4f39203319411aa5c73b490 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143032 Reviewed-by: Eike Rathke Tested-by: Jenkins --- source/text/shared/00/00000001.xhp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/text/shared/00/00000001.xhp b/source/text/shared/00/00000001.xhp index 97f683853e..8cad44d154 100644 --- a/source/text/shared/00/00000001.xhp +++ b/source/text/shared/00/00000001.xhp @@ -277,7 +277,7 @@ See also the following functions:
- The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in %PRODUCTNAME - PreferencesTools - Options - %PRODUCTNAME Calc - Calculate. + The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every regular expression metacharacter or operator with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in %PRODUCTNAME - PreferencesTools - Options - %PRODUCTNAME Calc - Calculate.
When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".
-- cgit