Regular Expression needed for tagging files / directories

Hello there,

I have started using the automated tagging feature. To get more out of this (wonderful!) concept, I need a regular expression which would catch a certain defined name in folder or file names.

For example, I would like to setup file retention for a scenario where any folder (or file) containing the expression “delete”, will auto-delete the folder / file within a given time period.

I am fine to setup auto retention as such, but I need a correct and working regular expression to make this work.

So my question is:

*** Which regular expression will work to catch all folder and file names which contain the word “delete” in any position of the folder/file name (beginning of folder/file name, middle or end) ?**

Can anyone help me with this?

Thanks and best regards

Having gone searching for similar information and not finding some clear worked examples, I had to sort how this works myself. The following is what I’ve been able to determine.

Not trying to imply anything but I don’t know how familiar you are with setting up auto tagging so let’s make sure you’re in the right spot. Go to Settings > Workflow

Create a rule group and give it a name and select your tag you want to set/apply
Add a rule

A few tips:

  • The “File name” filter only looks at the actual file name and not the path
  • There is no “File path” filter but one can built using the Request URL
  • all the filters are case insensitive

Presuming this is just to handle uploaded files you should use two rules as both conditions must be true for the tag to be applied:

  1. [Request URL] [is] [Files WebDAV]
  2. [Request URL] [matches] [/.delete./i]

note: square brackets("[ ]") are the individual fields in each rule

So this does two things

  1. checks that this is a WebDAV request. (The request url will include /remote.php/webdav/ in the upload if you look at the web server logs)
  2. the regular expression (regex) .*delete.* will match anything in the URL that contains the word delete

I uploaded with a file called “do_not_delete_this_file.txt” and it tagged it with the above rules.

If you wanted to isolate this to a specific directory such as tmp, the regex would change to

I hope this helps the next person trying to understand how auto tagging works.


Hi @slavevre,

thanks for picking this up.

I have on question though:

  1. [Request URL] [is] [Files WebDAV]

Will this cover uploads via desktop sync, drag & drop via web interface and using the upload button via web interface - all three scenarios?

In the “solutions” I have tried to figure out myself, only desktop sync and upload button were covered, but not “drag and drop”, this is why I am asking.