DS-User F1 Help for GUI (Context-Sensitive) : Regular Expression screen
 
Regular Expression screen
Regular Expression provides more specific filtering than the regular exclude filter. For example, you can filter to exclude individual filenames or patterns.
NOTE:  You should only use this option if you take the time to learn the Regular Expression syntax.
Use this screen to specify the Regular Expression to exclude from (or apply to) backups.
 
Edit
Expression
Pre-defined: Select from one of the pre-defined expressions in the list.
Custom: Enter the Regular Expression string to exclude.
Match Options
The default Match Options are to EXCLUDE the expression, with Case Sensitive filtering, against files and directories.
Case Sensitive
[Default is selected.] Indicates if the expression matching is CaSE sENsitIVe.
Negate
Negates the expression. This means it will exclude any files not matching the Regular Expression. This has the effect of permitting the negated expression to be backed up.
This option only works at the individual file level (not on directories).
For example, negating the pre-defined .*\.tmp expression allows you to exclude any files that do not have the .tmp extension.
Inclusion
Inverts the Regular Expression to filter for the specified pattern.
If you add one “Inclusion” to a backup set’s “Selected Items for Backup” List, only files matching the inclusion will be backed up. No other files will backed up, unless additional inclusion expressions are added.
For example, selecting this option with the pre-defined .*\.tmp expression allows you to include all .tmp files from the shares and directories selected for backup.
Add multiple “Inclusion” expressions to search for only the specified names or patterns.
Match
Select what this Regular Expression will filter:
files and directories: Not available with the “Negate” option.
files only
Test
Match against
Check the Regular Expression against a string you enter in this field. Click the check icon to verify if this string matches the Regular Expression.
Example: To exclude a specific filename from the backup, use \\filename\.ext$ (e.g. \\cache\.dsk$ will exclude the file cache.dsk).
Source code and some documentation available from: http://www.boost.org (search the site for “regex”).
Some of the syntax and semantics of the regular expressions supported by boost:regex are described below. Regular expressions are also described in the Perl documentation and in a number of other books, some of which have copious examples. Jeffrey Friedl's "Mastering Regular Expressions", published by O'Reilly, covers them in great detail. The description here is intended as reference documentation.
A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. As a trivial example, the pattern
The quick brown fox
matches a portion of a subject string that is identical to itself. The power of regular expressions comes from the ability to include alternatives and repetitions in the pattern. These are encoded in the pattern by the use of meta-characters, which do not stand for themselves but instead are interpreted in some special way.
There are two different sets of meta-characters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the meta-characters are as follows:
 
\
general escape character with several uses
^
assert start of string (or line, in multiline mode)
$
assert end of string (or line, in multiline mode)
.
match any character except newline (by default)
[
start character class definition
|
start of alternative branch
(
start subpattern
)
end subpattern
?
extends the meaning of (
also 0 or 1 quantifier
also quantifier minimizer
*
0 or more quantifier
+
1 or more quantifier
also "possessive quantifier"
{
start min/max quantifier
Part of a pattern that is in square brackets is called a "character class". In a character class the only meta-characters are:
 
\
general escape character
^
negate the class, but only if the first character
-
indicates character range
[
POSIX character class (only if followed by POSIX syntax)
]
terminates the character class