Full support for regex for filters

rclone should fully support regex for filters.

currently, due to a possible bug, rclone has partial support for regex for filters as per
https://forum.rclone.org/t/rclone-copy-using-regex-expression-using-include-multiple-expression-for-file-name/26846/15

so this works

rclone ls D:\files\reg --include={\d\d\d\d\d\d\d\d} --dump=filters 
2021/10/07 17:41:21 NOTICE: Automatically setting -vv as --dump is enabled
--- start filters ---
--- File filter rules ---
+ (^|/)(\d\d\d\d\d\d\d\d)$
- ^.*$
--- Directory filter rules ---
+ ^.*$
- ^.*$
--- end filters ---
2021/10/07 17:41:21 DEBUG : rclone: Version "v1.56.0" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "ls" "D:\\files\\reg" "--include={\\d\\d\\d\\d\\d\\d\\d\\d}" "--dump=filters"]
2021/10/07 17:41:21 DEBUG : Creating backend with remote "D:\\files\\reg"
2021/10/07 17:41:21 DEBUG : Using config file from "C:\\data\\rclone\\scripts\\rclone.conf"
2021/10/07 17:41:21 DEBUG : fs cache: renaming cache item "D:\\files\\reg" to be canonical "//?/D:/files/reg"
        0 20210101
        0 20210102
        0 20210103
2021/10/07 17:41:21 DEBUG : 2 go routines active

and this does not work

rclone ls D:\files\reg --include=*.{\d{8}}  --dump=filters 
2021/10/07 17:37:47 NOTICE: Automatically setting -vv as --dump is enabled
2021/10/07 17:37:47 Failed to load filters: can't nest '{' '}' in glob "*.{\\d{8}}"

created a github issue
https://github.com/rclone/rclone/issues/5672

1 Like

Pull request in progress:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.