Loading...

Filter by Wildcard Patterns

You can use the following wildcards to specify the pattern of files as a filter:

Wildcard

Definition

Example

*

Any number of characters.

This wildcard is used in following scenarios:

  • filter all files of a specific extension
  • filter all files when the file name starts with a specific pattern
  • filter all files under a specific directory
  • filter all files under a specific drive

C:\*.log filters all files with the .log extension on root of the C drive.

C:\folder\*.log where folder is the folder name filters files with the .log extension from a folder on the C drive. You must include the path to the folder in the filter.

ntuser* filters all files for which the file name starts with the word ntuser.

C:\Finance\Test\* filters only the files in the "Test" folder under the "Finance" folder on the C drive. Any sub-folders under the "Test" folder will be backed up.

C:\* filters all files located on root of the C drive.

**

All files under a specific directory

All files under a specific drive

C:\Test\Data\** filters all files and subdirectories under and including C:\Test\Data.

C:\**\Data\** filters all files and subdirectories below and including any directory called "Data" at any level in the C: volume.

G:\Users\**\xpprofile\*.log filters all files with the .log extension from any xpprofile subdirectory under Users directory.

G:\Users\**\xpprofile\ntuser* filters all filenames starting with ntuser from any xpprofile subdirectory under Users directory.

C:\** filters all the directories located on C drive.

C:\**\* filters all the files and directories on C drive.

?

Any one character

This wildcard can be used to filter following files or folders:

All files (or folders) for which any one character in the file name or the folder name is variable.

To filter files:

C:\access?.doc filters any files with the extension .doc on the C drive for which the name begins with- "access" followed by any one character such as access1.doc or access5.doc. However, access12.doc or access15.doc will not be filtered because the last two characters in the name are variable.  To filter access12 or access15, you must specify access?? in the subclient filters.

To filter folders:

Class?report filters any folder for which the character in the place of ? is variable. For example: Class1report and Class2report will be filtered. However, Class15report will be content indexed. 

[ ]

Set or range of characters.

C:\[a-m]*.doc filters any file with .doc extension on the C drive for which the name begins with the letters "a" through "m”.

C:\[AEIOU]*.doc filters any file name that ends with .doc and begins with the letters A, E, I, O, or U.

If you want to treat [] as literal characters and not as wildcards, you must use a special syntax. This will be useful when you want to filter a file which has [] in the file name. The special syntax allows you to define an escape character. Each character immediately following the escape character will then be treated literally and not as a wildcard.

For example: You want to filter a file with the name report[finance].doc on the C drive. In order for the square brackets to not be treated as wildcards, you must define an escape character. In the following example, the escape character is defined as the apostrophe (‘). The "e=" syntax is used to define the escape character. Since the square brackets are to be treated as literals, they both must be preceded by apostrophes. The filter entry in the subclient should look like this:

<P:e='>C:\report'[finance'].doc

Any character can be used as the escape character, as long as it is defined after the “e=” in the syntax and it precedes any character that is to be treated as a literal.

In addition, the escape character can itself be used as a literal. This can be achieved by prefixing it with another escape character. To filter a file with the name Test[Report]’2011’Financials.doc on the C drive, the following syntax should be used:

<P:e=’>C:\Test’[Report’]’’2011’’Financials.doc

[!]

The negation of a set or range of characters. You can use the wildcard in following scenario:

Filter all files in a directory except the files for which the name starts with any character from the specified set or range of characters.

C:\Windows\[!AEIOU]*.doc filters all .doc files in the C:\Windows directory that start with a letter other than A, E, I, O, or U.

Last modified: 9/27/2018 2:56:59 PM