Regex custom columns

Discussion related to "Everything" 1.5 Alpha.
Post Reply
anmac1789
Posts: 668
Joined: Mon Aug 24, 2020 1:16 pm

Regex custom columns

Post by anmac1789 »

Hello everyone is there a way for regex to match files based on custumn columns ? or does it only work for filenames?
void
Developer
Posts: 16669
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regex custom columns

Post by void »

Please try the regex: search modifier:

You can prefix any number of search modifiers with any search function.

For example:
regex:column1:^my.*regex.*search$
regex:column1:\d\d\d\d
anmac1789
Posts: 668
Joined: Mon Aug 24, 2020 1:16 pm

Re: Regex custom columns

Post by anmac1789 »

What is the 4 d's mean ? Also, by using regex with a search modifier such as custom column1 is this going to find all duplicates for which the filename and the custom column match ?
void
Developer
Posts: 16669
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regex custom columns

Post by void »

What is the 4 d's mean ?
\d matches a digit (0-9) with regex.
Also, by using regex with a search modifier such as custom column1 is this going to find all duplicates for which the filename and the custom column match ?
Regex will not help here.
Set your custom column to include the filename then right click your custom column and click Find column x duplicates.

-or-

Include the following in your search:
dupe:name;column1
anmac1789
Posts: 668
Joined: Mon Aug 24, 2020 1:16 pm

Re: Regex custom columns

Post by anmac1789 »

Thanks for the information. But, there isn't a simpler way to attach customn column1 inside this regex? <regex:^"E:\\(.*)$" fileexists:"S:\\$1:"> column1:=regex

regex:column1:^my.*regex.*search$ filexists:column1\\$1 ?? Also, how come regex doesn't find matching folders? For example, in this command
<regex:^"E:\\(.*)$" fileexists:"S:\\$1:">
it should find all matching filenames from the E:\ drive and S:\ drive, but instead all It found was 2 files from E:\System Volume Information\. How can I customize the search to also include matching folders, not just files?
void
Developer
Posts: 16669
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regex custom columns

Post by void »

Unfortunately, no.

fileexists: cannot reference column1, only regex matches.

You'll need to capture matches in column1 with regex and recall the regmatches with fileexists:


How can I customize the search to also include matching folders, not just files?
fileexists: is for files.
folderexists: is for folders.

Please try:

<file:regex:^E:\\(.*)$ fileexists:S:\\$1:> | <folder:regex:^E:\\(.*)$ folderexists:S:\\$1:>
anmac1789
Posts: 668
Joined: Mon Aug 24, 2020 1:16 pm

Re: Regex custom columns

Post by anmac1789 »

wait just so I understand, regex cannot match column1 right ?
void
Developer
Posts: 16669
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regex custom columns

Post by void »

The regex: search modifier can be used on column1:
anmac1789
Posts: 668
Joined: Mon Aug 24, 2020 1:16 pm

Re: Regex custom columns

Post by anmac1789 »

How can I use it on a custom column 1 ? How do I modify the syntax ?
void
Developer
Posts: 16669
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regex custom columns

Post by void »

Example usage:

addcol:col1;regmatch1 col1:=abc123 regex:col1:(\d\d\d)

The captured number 123 is shown under the Regular Expressions Match 1 column.
anmac1789
Posts: 668
Joined: Mon Aug 24, 2020 1:16 pm

Re: Regex custom columns

Post by anmac1789 »

Okay but lets say I wanted to match name:,size:,formatfiletime($dm:)
anmac1789
Posts: 668
Joined: Mon Aug 24, 2020 1:16 pm

Re: Regex custom columns

Post by anmac1789 »

void wrote: Fri Jun 23, 2023 10:43 am Unfortunately, no.

fileexists: cannot reference column1, only regex matches.

You'll need to capture matches in column1 with regex and recall the regmatches with fileexists:


How can I customize the search to also include matching folders, not just files?
fileexists: is for files.
folderexists: is for folders.

Please try:

<file:regex:^E:\\(.*)$ fileexists:S:\\$1:> | <folder:regex:^E:\\(.*)$ folderexists:S:\\$1:>
Is this supposed to find duplicate named folders ? I changed the folder name of one of them inside a parent folder and both the folders show up
Screenshot 2023-06-27 202436.jpg
Screenshot 2023-06-27 202436.jpg (91.04 KiB) Viewed 3910 times
This is the original folder/file structure...
Screenshot 2023-06-27 202905.jpg
Screenshot 2023-06-27 202905.jpg (68.45 KiB) Viewed 3910 times
This is the folder results structure after using the above folderexists command. I thought it is only supposed to match names if it exists in both search parameters. Why is this happening?

[update]: okay so I changed the location of one of the duplicate folder into another external hard drive, and re-ran the command and it seemed to pickup the '1st folder' . I understand that regex and findfiles and findfolders only work at the 1st level of directories..but not deeper level subfolders


But, now how do I match the folders given in deeper directory levels such as subfolder and subfolder of subfolders ... etc ?
anmac1789
Posts: 668
Joined: Mon Aug 24, 2020 1:16 pm

Re: Regex custom columns

Post by anmac1789 »

+1 any siggestions for this ?
Post Reply