Searching Filenames witch Space before Extension

General discussion related to "Everything".
Post Reply
data
Posts: 25
Joined: Sat Jun 17, 2017 8:17 am

Searching Filenames witch Space before Extension

Post by data »

Hi
I've tried to find files like
"test123 .txt".

But my Regex finds also files like
"test 123.txt" or
"test 123 .txt"

It looks like:
\s(?=[^.]*\.[^.]*$)

Whats the Trick?

best regards
Martin
therube
Posts: 4972
Joined: Thu Sep 03, 2009 6:48 pm

Re: Searching Filenames witch Space before Extension

Post by therube »

Might not be full-proof, but...

regex:.*\s\..{1,3}$


find anything
up to a space
followed by a "dot" (.)
ending with 1 to 3 characters

(some extensions may be more then 3)
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Searching Filenames witch Space before Extension

Post by NotNull »

data wrote: Mon Apr 01, 2024 12:45 pm \s(?=[^.]*\.[^.]*$)
Loose the first [^.] as that will search for any file/foldername that contaains a space anywhere in the stem:

Code: Select all

regex:"\s(?=\.[^.]*$)"

Somewhat simpler:
Everything 1.4:

Code: Select all

file:  regex:" \.[^.]+$"
Everything 1.5:

Code: Select all

endwith:stem:" "

(If you are running version 1.5, please post in the Everything 1.5 Alpha forum as answers can be quite different for each version as you cna see above)
data
Posts: 25
Joined: Sat Jun 17, 2017 8:17 am

Re: Searching Filenames witch Space before Extension

Post by data »

:o
Great solutions.

Best of is using this one for V1.5
endwith:stem:" "

Thanks a lot
Post Reply