Bug 162176 - Wildcards in Find and Replace: the position of wildcard given in the string in the Find box is not respected
Summary: Wildcards in Find and Replace: the position of wildcard given in the string i...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-24 16:06 UTC by Cor Nouws
Modified: 2024-07-24 19:35 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
test file using wildcard for formula and testing Find and Replace (122.13 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2024-07-24 16:06 UTC, Cor Nouws
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2024-07-24 16:06:15 UTC
Created attachment 195478 [details]
test file using wildcard for formula and testing Find and Replace

With bug 72196 the use of Wildcards has been implemented.
Opening the attachment in https://bugs.documentfoundation.org/show_bug.cgi?id=38125#c7 shows that it works correct in formula.

However, Find and Replace does not respect the position of wildcard given in the string in the Find box.

Added another example to the attachment.
In that file, searching in the range A17:A21 for '*es' (without the quotes) should have 3 matches.
Searching for 'es*' should have 2 matches.
However both '*es' and 'es*' give 5 matches, where the formula Countif does the correct thing.

Checked in Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d8c694b5d64b05da8c515e4ffe23c4bcc2376b0f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
But maybe, if it is an implementation error (in e.g. the commit mentioned here https://bugs.documentfoundation.org/show_bug.cgi?id=72196#c14) then it should be from version 5.2
Comment 1 Mike Kaganski 2024-07-24 16:29:38 UTC
This is not a bug.
Without the "Whole cell" checkbox (right below the Find box), this would match any cell containing es. With it checked, it works as you expect.
Comment 2 Cor Nouws 2024-07-24 16:46:19 UTC
(In reply to Mike Kaganski from comment #1)
> This is not a bug.
> Without the "Whole cell" checkbox (right below the Find box), this would
> match any cell containing es. With it checked, it works as you expect.
thanks Mike.
I considered using that checkbox, but can not think how it logically would change the behavior, so didn't try it.
Can you pls explain?
Comment 3 Mike Kaganski 2024-07-24 16:59:10 UTC
(In reply to Cor Nouws from comment #2)

Let's look at "España", and search string "*es"; without the "whole cells", this finds "es" with any count of previous characters (zero in this case, which is OK for *) as the *part* of "España".
Comment 4 Cor Nouws 2024-07-24 18:44:48 UTC
(In reply to Mike Kaganski from comment #3)
> (In reply to Cor Nouws from comment #2)
> 
> Let's look at "España", and search string "*es"; without the "whole cells",
> this finds "es" with any count of previous characters (zero in this case,
> which is OK for *) as the *part* of "España".
Still don't get it :)
"España" without the option is found, because * finds zero characters.. OK.
and
"España" with the option is not found, because * does not find zero characters?
Comment 5 Mike Kaganski 2024-07-24 19:35:25 UTC
(In reply to Cor Nouws from comment #4)
> "España" with the option is not found, because * does not find zero
> characters?

No, because the *es doesn't fit the whole word: there are characters "paña" that aren't described by the pattern (there's no wildcard for these characters).