Regex to retain files forever

Hi,

I’m new and don’t understand how to use the “Regexes To Retain File Forever” field. I need to use a list of documents as templates but the storage has a limit of a month.

Regexes To Retain File Forever (15.8 KB)

I read the Privacy Policy that explicitly says I can overwrite this for specific folders and files.

Paid Aspose Cloud API accounts using Aspose Storage

For Paid accounts, files uploaded to Aspose Storage are retained for a minimum of 30 days by default. The customer can remove these files at any time using the appropriate Storage API commands. The customer may also configure various automated file retention rules, (such as automatically deleting files after a number of days and other options), and exempt specific folders and files from the 30-day default using the account management screens.

Is there any sort of documentation with details or examples to use this feature?

Thanks in advance!

Best regards,

I’ve asked the storage team for examples and updated documentation. I will contact you when they share more specific answers.

I got an answer from the Storage team. You should use just regular regex, and after 30 days, before the files collecting are deleted, storage checks the regex you set and removes from file collection those files that are matched with the regex

Thanks for the explanation @yaroslaw.ekimov.
However, that doesn’t answer my original question: where in the documentation I could find examples of the regex composition or an idea of how to create a correct expression?

Thanks again

I asked them to update the documentation. Once they are done, I will share it with you.
For example, you can put

^Template.docx$

to retain a file that has the name Template.docx
Or like this

(?i)^.template..docx$

to preserve all .docx files that contain template in their name.

Thanks, quite useful!
Do you have an example for a folder and all its content including subdirectories?

I believe this is an example you can check; if it won’t help, please feel free to ask.

^/your-directory(/.*)?$