Skip to main content

Include/Exclude Patterns

The Include Patterns and Exclude Patterns settings allow you to selectively copy items from the source to the destination of your sync.

If no Include Patterns or Exclude Patterns are provided, the full contents of the source will be copied to the destination.

Include Patterns

Use glob patterns to define the items that will be included in the sync.

If set, only path names matching one or more of these patterns will be synced. Path globs are supported in the same way they are supported in Automations. Prefix patterns with **/ if you want them to apply to filenames in any folder or subfolder.

Multiple include patterns can be configured for a single sync.

Exclude Patterns

Use glob patterns to indicate items that will be excluded from the sync. If set, any path names matching one or more of these patterns will be ignored and excluded from the sync.

This setting takes precedence over the include patterns setting if a path matches both settings.

If a folder name matches any Exclude Patterns, the entire folder will not be copied. That means that all contents of the folder, including all of its recursive subfolders and their contents, will also be excluded.

Path globs are supported in the same way they are supported in Automations. Prefix patterns with **/ if you want them to apply to filenames in any folder or subfolder.

Multiple exclude patterns can be configured for a single sync.

Glob Pattern Matching

Glob patterns allow you specify the criteria for matching files and folders to be included or excluded with a sync. Glob allows for both folder path matching and for file name matching.

Path Matching

The * matches any folder at that specific level in the path but excludes subfolders, while the double asterisk ** matches subfolders recursively. For instance, path/to/* matches path/to/folder1 and path/to/folder2, but not path/to/folder1/subfolder, whereas path/to/** includes all subfolders.

The question mark ? matches any single character, and square brackets [] can be used to match any character from a set, similar to regular expressions.

File Name Matching

Specify a pattern for file names to match using standard text with or without wildcards, or file extension matching (like *.pdf).

For example, the pattern matching text *paid* matches any file with a name containing the word 'paid' (case-insensitive).

You can also build an expression to match any single character using ?, or match an array of characters using [].

To match special characters literally, precede it with a backslash and enclose that pair with square brackets. For example to match a literal ?, use [\?].

You can negate any digits or characters in the file name using ^. For instance, [a-z].*will match all file names that contain only letters, while [^a-z].* means it won't match if the file name contains any characters between 'a' and 'z'.

Curly brackets {} can be used to denote parts of a pattern which will accept a number of alternatives, separated by commas ,. These alternatives can either be literal text or include special characters including nested curly brackets. For example *{Mon,Tue,Wed,Thu,Fri}* would match any files whose name contains abbreviated weekdays, and 202{3-{0[7-9],1?},4-0[1-6]}-* would match files starting with dates from 2023-07-01 through 2024-06-30.

Full Path and File Name Matching

You can combine path matching together with file name matching.

For example, to match PDF files within a specific subfolder, you can use a pattern like path/to/subfolder/*.pdf.

To match PDF files within any subfolder, whose name contains 2024 or 2025, you can use a pattern like **/*202{4,5}*.pdf.

Precedence

Exclude takes precedence over include. If a file name matches both an Include pattern and an Exclude pattern, the file will be excluded from the sync.

Get Instant Access to Files.com

The button below will take you to our Free Trial signup page. Click on the white "Start My Free Trial" button, then fill out the short form on the next page. Your account will be activated instantly. You can dive in and start yourself or let us help. The choice is yours.

Start My Free Trial