Bug 132380 - Tools> Options> Calc> Calculate> Case sensitive should be used by functions handling regular expressions
Summary: Tools> Options> Calc> Calculate> Case sensitive should be used by functions h...
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-24 14:05 UTC by pierre-yves samyn
Modified: 2020-04-25 08:40 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
FindLowerCase.ods (11.65 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-24 14:06 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierre-yves samyn 2020-04-24 14:05:42 UTC
Description:
Hi

With Edit> Find & Replace we can search: [a-z], tick "Match case" & "Regular expressions" then find all to select cells containing lowercase letters.

SEARCH function supports regular expressions but does not use Tools> Options> Calc> Calculate> Case sensitive. 

So SEARCH function does not distinguish between upper and lower case letters.

It is therefore impossible to do the same search as above:

=SEARCH("[a-z]";A2)

As workaround we have to do =NOT(EXACT(UPPER(A2);A2))

Steps to Reproduce:
1. Open FindLowerCase.ods attached
2. See B3 result is 1
3. Tick or Untick "Tools> Options> Calc> Calculate> Case sensitive" according to the status of the option
4. See B3 result 

Actual Results:
1

Expected Results:
#VALUE (no lowercase in A3)


Reproducible: Always


User Profile Reset: No



Additional Info:
All functions (e.g. COUNTIF) that support regexp should also use this option.
Comment 1 pierre-yves samyn 2020-04-24 14:06:14 UTC
Created attachment 159900 [details]
FindLowerCase.ods
Comment 2 Mike Kaganski 2020-04-24 14:34:09 UTC
The case-insensitive behaviour of SEARCH is defined in the OpenFormula [1]. Additionally, starting with v.7.0, regular expressions in functions honor (?-i)/(?i) flags [2] (tdf#78840). So =SEARCH("(?i)[a-z]";A2) should work in v.7.0.

Closing WONTFIX, do you agree?

[1] http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018874_715980110
[2] http://userguide.icu-project.org/strings/regexp#TOC-Flag-Options
Comment 3 pierre-yves samyn 2020-04-25 08:40:47 UTC
Hi

(In reply to Mike Kaganski from comment #2)
> Additionally, starting with v.7.0, regular expressions in functions honor
> (?-i)/(?i) flags [2] (tdf#78840). 


Blimey, I had searched (badly then). Thanks a lot, you and Eike, of course.


> Closing WONTFIX, do you agree?

of course :)

Best regards
Pierre-Yves