-
Notifications
You must be signed in to change notification settings - Fork 3
Examples
For each MOVE rule, enter a regex pattern to match against files in the source folder, and a regex template to use while naming the files created in the destination folder. For DELETE_STALE rules, the latter is not required.
The pattern must match the entire file name (along with its extension). Here are some examples:
trackbook-backup\.zipImportant
Escape special characters, like periods and parentheses.
AntennaPodBackup(.*)\.dbCaution
Ensure that the prefix is specific enough. Too-broad patterns may lead to data loss.
TubularData-(?<date>\d{8})_(?<time>\d{6})\.zipThe template can contain references to groups captured in the pattern. Prefer named groups to avoid ambiguity. Here are some examples:
antennapod.db
Important
If a file with the same name is already present in the destination and the "overwrite existing" option has not been turned on, the flow will fail.
tubular${date}.zip
Tip
${folder} is a special reference which will contain the name of the direct parent of the file being considered. This is useful for "flattening" rules (i.e., rules which scan subfolders, but don't recreate structure).
Example: for the file /storage/emulated/0/Foo/Bar/Baz.png, ${folder} will be replaced by Bar.
Tip
${uuid} is a special reference which will be replaced by a random UUIDv4 (like 5658d008-940a-433c-9c6a-fdcee41e6552, for instance). This is useful when you wish to prevent collisions and/or anonymize names.
tubular$1.zip
Tip
$0 will be replaced by the source file's name (including the extension). This is useful for copying/moving files without renaming them.
Use these examples to build your own patterns and templates. You can visit rexegg.com to learn regex (refer to the Java engine), and regexr.com to build & test patterns. For advanced patterns, it might be a good idea to test against the actual Kotlin regex engine, which you can do in this playground.
If you're having difficulty targetting certain files, you can raise an issue describing your situation.