Why does this asterisk fail?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
terrypin
Posts: 208
Joined: Mon Mar 18, 2013 2:41 pm

Why does this asterisk fail?

Post by terrypin »

A search with
*march*.mp3 j:\for sd\04*

delivered no hits.

But removing the asterisk
*march*.mp3 j:\for sd\04

delivered the nine hits I was looking for, such as

J:\For SD\04 OTHER\0265-Elgar - Pomp and Circumstance March No.1 (Land of Hope and Glory) - Copy.mp3

Why this difference please. Is an asterisk not valid with a folder?
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: Why does this asterisk fail?

Post by void »

sd\04*
Everything will look for the full path starting with sd\04
The full path does not start with sd\04, it starts with J:\For SD\sd\04

Please try the following search:
*sd\04*

-or-

"J:\For SD\04*"



sd\04
is treated exactly the same as:
*sd\04*
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Why does this asterisk fail?

Post by Stamimail »

void wrote: Fri May 13, 2022 11:00 am
sd\04*
Everything will look for the full path starting with sd\04
The full path does not start with sd\04, it starts with J:\For SD\sd\04
why looking for the full path?

I think when a user is typing sd\04* he expect Everything to look for
<BeginningOfFilename OR WhiteSpace>sd\04<zero or more characters>
horst.epp
Posts: 1443
Joined: Fri Apr 04, 2014 3:24 pm

Re: Why does this asterisk fail?

Post by horst.epp »

Stamimail wrote: Fri May 13, 2022 12:12 pm
void wrote: Fri May 13, 2022 11:00 am
sd\04*
Everything will look for the full path starting with sd\04
The full path does not start with sd\04, it starts with J:\For SD\sd\04
why looking for the full path?

I think when a user is typing sd\04* he expect Everything to look for
<BeginningOfFilename OR WhiteSpace>sd\04<zero or more characters>
No, thats not what I expect in this case.
Without any regex, ^ for example, I would not expect that the sd string is on the beginning of a file name.
I only expect to see sd at some place in the filename followed by \
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: Why does this asterisk fail?

Post by void »

Consider disabling match whole filename when using wildcards:
  • In Everything, from the Tools menu, click Options.
  • Click the Search tab on the left.
  • Uncheck Match whole filename when using wildcards.
Now sd\04* will match anywhere in the full path.
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Why does this asterisk fail?

Post by Stamimail »

horst.epp wrote: Fri May 13, 2022 12:32 pmI only expect to see sd at some place in the filename followed by \
That's happen when the user type "sd\04" without the asterisk. Why the user tends to add the asterisk "sd\04*"?

@void
A mismatch to expectations with the use of an asterisk happens a lot. Consider changing the default behavior.
terrypin
Posts: 208
Joined: Mon Mar 18, 2013 2:41 pm

Re: Why does this asterisk fail?

Post by terrypin »

void wrote: Fri May 13, 2022 12:38 pm Consider disabling match whole filename when using wildcards:
  • In Everything, from the Tools menu, click Options.
  • Click the Search tab on the left.
  • Uncheck Match whole filename when using wildcards.
Now sd\04* will match anywhere in the full path.
*sd\04* J:
doesn't work, delivering:

Name Path
[folder icon] 04 OTHER J:\For SD

Same for
"J:\For SD\04*"

I was looking for MP3 FILES inside any folders called J:\FOR SD\04 containing the string 'march'.
Note the space in the parent folder name.
Case doesn't matter.

'Match whole filename when using wildcards' is unchecked.

Having heard the music I knew it was a march. The answer was the one I showed. (There were nearly a thousand MP3s in each of the several matching folders, which is why I didn't simply scan visually.)
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: Why does this asterisk fail?

Post by void »

Sorry, I was focused on the sd\04 part.

Please try the following search:

march .mp3 "j:\for sd\04"



*march*.mp3
is the same as:
march .mp3



j:\for sd\04*
is two terms:
j:\for AND sd\04*
Use double quotes to escape spaces:
"j:\for sd\04*"



"j:\for sd\04*"
is the same as:
"j:\for sd\04"



The reason:
*march*.mp3 j:\for sd\04*
does not match any results is because of the term sd\04*
sd\04* is looking for full paths starting with sd\04 (when they start with j:\for)



If you disable Tools -> Options -> Search -> Match whole filename when using wildcards, your original search should work:
*march*.mp3 j:\for sd\04*
With Match whole filename when using wildcards disabled:
sd\04*
is the same as:
sd\04


A mismatch to expectations with the use of an asterisk happens a lot. Consider changing the default behavior.
I'll consider it.
Everything currently uses the old-school DOS style wildcards and Windows open/save dialog wildcard syntax.
That is, using * or ? will match the whole filename.
Everything 1.5 will match whole filename parts (instead of the whole full path and filename).
For example: "for sd\04*" will match "J:\for sd\04"

Currently, if you would like the Vista+ search syntax:
Disable Tools -> Options -> Search -> Match whole filename when using wildcards
Enable the whole-word search modifier by prefixing your wildcard search with ww:
ww:sd\04*

With Match whole filename when using wildcards disabled, you will no longer be able to find filenames starting with or ending with text. (lost functionality)
Also search performance is significantly slower.
terrypin
Posts: 208
Joined: Mon Mar 18, 2013 2:41 pm

Re: Why does this asterisk fail?

Post by terrypin »

void wrote: Fri May 13, 2022 11:16 pm Sorry, I was focused on the sd\04 part.

Please try the following search:

march .mp3 "j:\for sd\04"
Thanks, that works OK.
*march*.mp3
is the same as:
march .mp3
But I don't see why
march*.mp3 "j:\For Sd\04"
doesn't work? I thought asterisk could represent anything? Is Space an exception?

And why does this work?
*march*.mp3 "j:\For Sd\04"
j:\for sd\04*
is two terms:
j:\for AND sd\04*
Use double quotes to escape spaces:
"j:\for sd\04*"
"j:\for sd\04*"
is the same as:
"j:\for sd\04"
OK, I think I'm getting there. So '*' can also represent nothing - except Space, yes? But not intuitive IMO.

The reason:
*march*.mp3 j:\for sd\04*
does not match any results is because of the term sd\04*
sd\04* is looking for full paths starting with sd\04 (when they start with j:\for)
Understood
If you disable Tools -> Options -> Search -> Match whole filename when using wildcards, your original search should work:
*march*.mp3 j:\for sd\04*
With Match whole filename when using wildcards disabled:
sd\04*
is the same as:
sd\04
Ah, that's a setting I didn't realise was enabled. Well, actually don't think I knew it existed! And certainly unaware of its very significant role.

My original does indeed work with that disabled. Of course, I will probably now forget, and be puzzled by future behaviour.
A mismatch to expectations with the use of an asterisk happens a lot. Consider changing the default behavior.
;)

Yes please. I do find some of this non-intuitive.
void
Developer
Posts: 16683
Joined: Fri Oct 16, 2009 11:31 pm

Re: Why does this asterisk fail?

Post by void »

But I don't see why
march*.mp3 "j:\For Sd\04"
doesn't work? I thought asterisk could represent anything? Is Space an exception?

And why does this work?
*march*.mp3 "j:\For Sd\04"
march*.mp3
will look for files starting with march and ending with mp3
Your mp3 files most likely do not start with march, (they might start with 01 - artist - album - march title.mp3)

The * will match any character, any number of times.
The confusion here is most likely Everything matching the whole filename when using a *

A space in Everything means AND.
The search:
abc 123
means abc AND 123

Use double quotes to escape spaces.

Consider searching for:
march *.mp3 "j:\For Sd\04"
(use * only in *.extension searches, eg: *.mp3)
Post Reply