Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rclone filters to support regex #5672

Closed
asdffdsazqqq opened this issue Oct 7, 2021 · 3 comments
Closed

rclone filters to support regex #5672

asdffdsazqqq opened this issue Oct 7, 2021 · 3 comments

Comments

@asdffdsazqqq
Copy link
Contributor

asdffdsazqqq commented Oct 7, 2021

The associated forum post URL from https://forum.rclone.org

https://forum.rclone.org/t/full-support-for-regex-for-filters/26883

What is your current rclone version (output from rclone version)?

rclone v1.56.0
- os/version: Microsoft Windows 10 Pro 2009 (64 bit)
- os/kernel: 10.0.19043.1266 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.16.5
- go/linking: dynamic
- go/tags: cmount

What problem are you are trying to solve?

that rclone should fully support regex for filters
currently, rclone partially supports regex

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

but 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}}"

How do you think rclone should be changed to solve that?

please allow for full regex functionality. thanks

@darthShadow
Copy link
Member

Duplicate of #4074

@ncw
Copy link
Member

ncw commented Oct 8, 2021

I just wrote some ideas of how this could be implemented on the original issue #4074 (comment)

Comments there please @asdffdsazqqq and @darthShadow if you are interested!

@darthShadow
Copy link
Member

Closing to keep all relevant discussion confined in a single issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants