Help with --excluded flag and \d+ regex

Hi, i want to ignore from sync any files with a numeric extension, so for example a directory containing:

  • file.1
  • file.10
  • file.101
  • file.2
  • file.2.mp3
  • file.3.docx
  • file.docx
  • file.mp3.mp4
  • file.mp4
  • file.mp3

The files "file.1, file.10, file.101 and file.2" should not get uploaded to the server.
so far i have tested with the ls command without success the following filters:

  • rclone ls remote: --exclude '\.[\d]+'
  • rclone ls remote: --exclude '\.[\d]+$'
  • rclone ls remote: --exclude '\.\d+$'
  • rclone ls remote: --exclude '*.\d+'

and many many more :confused:
i do not understand why for example --exclude '*.\d+' do not work when --exclude '*.\d' WORKS (but only filters the files file.1 and file.2)...

so any ideas will be deeply appreciated!
BTW i am running:

  • rclone v1.54.1
  • os/arch: linux/amd64
  • go version: go1.15.8

Welcome to the forum!

The + is not a supported operator. Filter syntax is not regex, it's more glob but with a few elements from regex such as character classes like \d.

I don't know of a filter which does what you want, except repeating:

--exclude *.\d --exclude *.\d\d --exclude *.\d\d\d ...

The + is not a supported operator

that explains everything :neutral_face:

--exclude *.\d --exclude *.\d\d --exclude *.\d\d\d

Well i will use this, i expect no more than 4 numbers in the extension so this (with another \d) will work. so thanks! and have a nice day.

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