How to filter specific extension with symbol and non-alphanumeric character in dupeguru

Viewed 70

Sorry for my English.

I am trying to tidy up my ~7TB data. There are some duplicate files & folders in that 7TB data. I want to delete the duplicate files so that I have some space to backup my new data (The HDD Price is still rising). My current method is to use dupeguru to scan and delete the folders and files.

The situation is: I have deleted the duplicate folders, now I want to delete the duplicates files except some files with specific extension.

The filter function in dupeguru is Python Regular Expression. I try to filter the photo and xml files, I use the following code to do the job.

^\w+\.png
^\w+\.jpg
^\w+\.xml

The result is here:

X:\D\Desktop\sd\Pictures\FullSizeRender - Copy (2).jpg
X:\D\NEW\Old_System 3\1\Desktop\sd\Pictures\FullSizeRender - Copy (2).jpg

I find that I am not able to filter the files with name including symbol or Mojibake character. What is the problem?

1 Answers

Your expression is to restrictive. \w is [A-Za-z0-9_] but your filenames contain far more than these characters. Maybe you could get along with:

^[-\w()\\: ]+\.(?:jpg|png|xml)$

See a demo on regex101.com.

Related