Sort by number at the end of folder name

General discussion related to "Everything".
Post Reply
siomosp
Posts: 17
Joined: Sat Feb 27, 2021 11:43 am

Sort by number at the end of folder name

Post by siomosp »

Hi, it is possible to add sorting by the number at the end of folder name ?
Image
void
Developer
Posts: 16734
Joined: Fri Oct 16, 2009 11:31 pm

Re: Sort by number at the end of folder name

Post by void »

Requires Everything 1.5.

Include the following in your search:
regex:(\d+)
From the View menu, under the Sort by menu, under the Search submenu, click Regular Expression Match 1.

You can also show the Regular Expression Match 1 column by right clicking the result list column header and checking Search -> Regular Expression Match 1.
siomosp
Posts: 17
Joined: Sat Feb 27, 2021 11:43 am

Re: Sort by number at the end of folder name

Post by siomosp »

Brilliant!
Image

Thanks!!!
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Sort by number at the end of folder name

Post by harryray2 »

What do the Regular Expression Match columns show?

Thanks.
Mizufluffy
Posts: 62
Joined: Sun Jun 13, 2021 10:22 am

Re: Sort by number at the end of folder name

Post by Mizufluffy »

harryray2 wrote: Sat Nov 13, 2021 1:33 pm What do the Regular Expression Match columns show?

Thanks.
If you search using regular expressions, for example with regex: function, then it shows the part that matches the regular expression. For example, on the example below I created some random files that all had something in common, in this case they all had some digits before the extension.
2021-11-13 15_48_27-_Everything_RegexMatch.jpg
2021-11-13 15_48_27-_Everything_RegexMatch.jpg (126.21 KiB) Viewed 4902 times
This regex,

Code: Select all

regex:(\d+)
is searching for digits, \d, one or more time, +, and it's captured with brackets, (), in other words it matches with a substring of digits with length one or longer. If you have multiple capture groups then you could use multiple Regular Expression Match columns.

Here's an example what you can for example do with capturing groups with file renaming using regex and how to reference those groups. So, if the first group is () then you reference to it with \1, then the next group is () with reference \2 and so on.
2021-11-13 16_05_47-Everything_Regex_Rename.jpg
2021-11-13 16_05_47-Everything_Regex_Rename.jpg (254.03 KiB) Viewed 4902 times
Here is one more example. This time with Regular Expression Match 1 and Match 2. Notice how the whole highlighted area isn't the same as in Match
columns but only very specific parts of the regex pattern. What I'm basically matching is the column after #2 and the column after #3. Similarly I could capture basically any other part of a file name and then use that to for example sort, find duplicates among other things.
2021-11-13 16_10_54-Everything_RegexMatch2.jpg
2021-11-13 16_10_54-Everything_RegexMatch2.jpg (249.07 KiB) Viewed 4902 times
In other words, Regular Expression Match 0 - 9 is a very handy way to find and use only portion of the file name or other property. I could, for example, do regex:path:"(\\r\w{4})", and get a match for folder that starts with letter r and has four word characters after it. Anyway, what I mean is that there are a lot of use cases for these matches.
Post Reply