Please enable JavaScript to view this site.

Duplicate File Detective Help

Navigation: Duplicate File Detective Projects > Search Filtering

File Names

Scroll Prev Top Next More

During the duplicate file search process, every file's name is examined and compared against the settings defined in the File names section of the Search Filtering docking panel.

 

File name masks can be either inclusive or exclusive (see below for details).

 

File name masks can be defined using one of two syntaxes: wildcard patterns (the default) or more advanced regular expressions. Use the "Use regular expression matching" switch in the file name masks section of the search filtering panel to switch between these two modes.

 

Wildcard Patterns (Including and Excluding)

 

When operating in wildcard pattern mode, file name masks are comprised of patterns of characters, with multiple sets of masks separated by semicolons. Wildcard characters include '?' and '*', which match either one instance or multiple instances of any character (respectively). Any other (non-wildcard) character matches itself.

 

Further, any file name mask can be preceded by a tilde character ( '~' ), which specifies that the mask is exclusionary. If a file name matches an exclusionary mask, the file will always be skipped.

 

You can also use the "compare full path" switch to compare the entire file system path (not just the file name) against your defined filter.

 

Wildcard Pattern Examples

 

Here are a few examples of wildcard file name masks:

 

mypicture.bmp - This mask has no wildcard characters, and is therefore a literal match. Only files named "mypicture.bmp" will be included in the duplicate comparison process.

*.bmp - This mask uses the asterisk ('*') character to include any files with a ".bmp" extension in their names.

*.bmp;*gif;*jpg - This is a compound mask, with separate entries separated by semicolons. This mask will match any ".bmp", ".gif", or ".jpg" files it encounters.

~family*;*.bmp - The first element of this compound mask is preceded by a tilde ('~'), which means that it will excluded any files that start with "family". It will then include any files with a ".bmp" extension in their names.

 

The file names section of the Search Filtering docking pane also includes a Presets button, which you can click for easy access to a range of built-in masks (called File Groups). These can help you to get started quickly, and can also be customized to suit your needs.

 

Important Note: When using wildcards in filename masks, keep in mind that a mask of '*.*' is subtly different than just '*'. The former requires that a dot (.) be included in the file name, while the latter does not. In other words, the *.* pattern will not match file names that don't have an extension - if you wish to match these, use just a single asterisk (*) instead.

 

Regular Expressions

 

As noted above, filename masks can also be defined using powerful regular expression syntax. Regular expressions are formulas that can be used to match strings of text that follow some pattern. They allow their users to succinctly express a set of character matching rules that would otherwise require a large number of switches and logical operations.

 

Duplicate File Detective uses an ECMAScript compliant regular expression engine, and associated syntax.

 

This help file will not provide an in-depth tutorial on the formation of regular expressions, because a large number of such tutorials are freely available on the web  (visit your favorite search engine and enter "regular expressions" or "ECMAScript regular expression syntax" into the search box to find them).

 

Regular expression examples:

 

.* - Matches everything (e.g. any file name).

.*(back).* - Matches any file name that contains the word "back"

^(?!.*settings).* - Matches any file name that does NOT contain the word "settings".

^(?!.*settings)(.*wonder).* - Matches any file name that contains the word "wonder" but does NOT contain the word "settings".

^front.* - Matches any file name that starts with the word "front".

.*\d{4}.* - Matches file names containing a four-digit number.

 

 

Excluding Protected File Types

 

By default, Duplicate File Detective will exclude protected file types from the duplicate search process. To manage protected file types, navigate to the Protection tab of the Preferences window.