regex_pics_del
开源地址:
警告
本程序仅适用于图片等常规文件,代码文件等不在考虑范围内
原理
程序使用了正则表达式对文件(通常是图片)的文件名(不含后缀)的匹配项进行分组,通过遍历每组内的文件大小删除较小的文件,对于大小相同的文件将比较sha3_256值,相同的将自动删除
使用方法:
<程序地址.exe> <正则表达式> <要匹配的组> <文件夹(仅允许一个)>
示例:
现有如下图片:
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#18435810.png
D:\Downloads\UI_Codex\UI_Codex_PhotoDisplayStand_08#2592427.png
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#2187382.png
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#2557.png
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#3239116.png
D:\Downloads\UI_Codex\UI_Codex_PhotoDisplayStand_08.png
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#67994.png
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu.png
文件名列表:
UI_Codex_Scenery_CYCengYanJuYuanZhu#18435810
UI_Codex_PhotoDisplayStand_08#2592427
UI_Codex_Scenery_CYCengYanJuYuanZhu#2187382
UI_Codex_Scenery_CYCengYanJuYuanZhu#2557
UI_Codex_Scenery_CYCengYanJuYuanZhu#3239116
UI_Codex_PhotoDisplayStand_08
UI_Codex_Scenery_CYCengYanJuYuanZhu#67994
UI_Codex_Scenery_CYCengYanJuYuanZhu
文件名列表正则匹配情况
分组情况:
---
UI_Codex_PhotoDisplayStand08
---
D:\Downloads\UI_Codex\UI_Codex_PhotoDisplayStand_08.png 7712kb
D:\Downloads\UI_Codex\UI_Codex_PhotoDisplayStand_08#2592427.png 8800kb
---
UI_Codex_SceneryCYCengYanJuYuanZhu
---
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#18435810.png 123kb
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#2187382.png 456kb
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#2557.png 678kb
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#3239116.png 789kb
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#67994.png 33kb
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu.png 789kb
最终结果
D:\Downloads\UI_Codex\UI_Codex_PhotoDisplayStand_08#2592427.png
D:\Downloads\UI_Codex\UI_Codex_Scenery_CYCengYanJuYuanZhu#3239116.png
感谢
感谢 https://regex101.com/ 提供了方便、易得、鲜明的正则检查