Please help: Regular expressions

The best solution for finding and removing duplicate files.
Post Reply
00
Posts: 14
Joined: Thu Aug 27, 2015 4:54 pm

Please help: Regular expressions

Post by 00 »

Please tell me what I'm doing wrong.

I want to find duplicate .png files in subdirectories below 'L:\Pictures\'

So I'm using the Selection Assistant: 'Select by text pattern' where column name = path.

I've set the regexpression = ^L:\\Pictures\\.*\\*.png$

eg. this file should match - 'L:\Pictures\abc\def\ghi\jkl.png' but it doesn't.

The expression works in this online tester: https://regex101.com/r/fW4aL8/1
but it doesn't in Duplicate Finder. Any help would be appreciated. Thanks.
User avatar
therube
Posts: 615
Joined: Tue Jun 28, 2011 4:38 pm

Re: Please help: Regular expressions

Post by therube »

Can't answer on the regex end, but why are you even needing regex in this case?

Why not set the Location: to L:\Pictures & the Filter: to *.png ?
00
Posts: 14
Joined: Thu Aug 27, 2015 4:54 pm

Re: Please help: Regular expressions

Post by 00 »

Bump... Can someone please confirm that regular expressions work and tell me what I'm doing wrong?

Re:
Can't answer on the regex end, but why are you even needing regex in this case?

Why not set the Location: to L:\Pictures & the Filter: to *.png ?
The location is set to multiple paths and I don't want to have to throw away the time it required to do that search and take more time doing multiple sub-searches. Seems to me that RegEx would take the minimum time to filter already performed searches without having to search again.
User avatar
DigitalVolcano
Site Admin
Posts: 1753
Joined: Thu Jun 09, 2011 10:04 am

Re: Please help: Regular expressions

Post by DigitalVolcano »

^L:\\Pictures\\.*\\*.png$
This won't work as the filename (*.png) part is in a different column - it will only match on the selected column (path) unfortunately.


The best way to do this with the current version is-
Selection Assistant ->Work only on currently selected rows = checkmarked
Sort by folder name and select (highlight row) all folders below L:\Pictures
Selected Assistant->Select by text pattern, column='File name' pattern = .png (non-regex) or png$ (regex)
00
Posts: 14
Joined: Thu Aug 27, 2015 4:54 pm

Re: Please help: Regular expressions

Post by 00 »

^L:\\Pictures\\.*\\*.png$
This won't work as the filename (*.png) part is in a different column - it will only match on the selected column (path) unfortunately.
Question: Why does the tool allow sorting by columns, all except by "File Type"? To me, this seems like a bug.
It would also be nice to first sort by file type and then by path, or the opposite.

Additionally, shouldn't the selection assistant -> select by text pattern -> column name = file name, accept wild cards? Why can't I search for *.png (or *.p*) given that the extension is part of the file name?

Thank you.
User avatar
DigitalVolcano
Site Admin
Posts: 1753
Joined: Thu Jun 09, 2011 10:04 am

Re: Please help: Regular expressions

Post by DigitalVolcano »

If you want a wild card you'll need to use a regex.

e.g.

Code: Select all

\.png$
Alternately you can right-click on the file type you require and select Mark->All files of this type.
Post Reply