Hi Celia,

I am not sure that the paragraph is obsolete.

Taking your example a little further, suppose one of the cells in the range B1:B13 contains the string "$Celia".

 * Firstly, let us assume that "No wildcards or regular expressions in
   formulas" is selected on the Tools > Options > LibreOffice Calc >
   Calculate dialog. Then the formula =COUNTIF(B1:B13,"$Celia") should
   give the expected value of 1.
 * If we now select "Enable regular expressions in formulas" on the
   Tools > Options > LibreOffice Calc > Calculate dialog, then the same
   formula (=COUNTIF(B1:B13,"$Celia")) gives the answer 0. Why? Because
   the $ is a special character.
 * With regular expressions still enabled, the formula
   =COUNTIF(B1:B13,"\$Celia") gives the answer 1 again. So the
   backslash is required before the $ so that the regex processor does
   not treat it as a special character.

I hope this makes sense and answers your question.

Regards,

Steve Fanning



On 16/01/2021 01:06, Celia Palacios wrote:
Hello again!

Here's another question. Same Calc Guide 6.2:
On page 244 this paragraph says:

«Activating the *Enable regular expressions in formulas* option means all the above functions will require any regular expression special characters (such as parentheses) used in strings within formulas, to be preceded by a backslash, despite not being part of a regular expression. These backslashes will need to be removed if the setting is later deactivated.»

However, I have the aforementioned option enabled, and I'm using this formula which yields the appropiate result:

=COUNT.IF(B1:B13,"^u.a$") for searching "uva" or "una" in cells, but not "viuda" nor "suma".

I can trace back the paragraph to the OpenOffice wiki (https://wiki.openoffice.org/wiki/Documentation/How_Tos/Regular_Expressions_in_Calc#Regular_expressions_in_Calc_functions).

I think that paragraph is obsolete.


Celia

--
To unsubscribe e-mail to: [email protected]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/documentation/
Privacy Policy: https://www.documentfoundation.org/privacy

Reply via email to