|
Filtering files for the action
You can define one or more include or exclude filespec filters in a format similar to the following example:
*.jpg|*.jpeg|*.gif
Note that each filter is separated by a vertical bar '|' character. If the above is included as an "Include" filter only files with extensions .jpg, .jpeg, or .gif will be returned.
Similarly, if the above filter is specified as an "Exclude" filter all files except those of type .jpg, .jpeg, or .gif will be returned.
Regular Expressions
Alternatively, Include and Exclude filters may be specified using a subset of the typical regular expression syntax. The following syntax is allowed:
Meta character
|
Meaning
|
.
|
Matches any single character.
|
[ ]
|
Indicates a character class. Matches any character inside the brackets (for example, [abc] matches "a", "b", and "c").
|
^
|
If this metacharacter occurs at the start of a character class, it negates the character class. A negated character class matches any character except those inside the brackets (for example, [^abc] matches all characters except "a", "b", and "c").
If ^ is at the beginning of the regular expression, it matches the beginning of the input (for example, ^[abc] will only match input that begins with "a", "b", or "c").
|
-
|
In a character class, indicates a range of characters (for example, [0-9] matches any of the digits "0" through "9").
|
?
|
Indicates that the preceding expression is optional: it matches once or not at all (for example, [0-9][0-9]? matches "2" and "12").
|
+
|
Indicates that the preceding expression matches one or more times (for example, [0-9]+ matches "1", "13", "666", and so on).
|
*
|
Indicates that the preceding expression matches zero or more times.
|
??, +?, *?
|
Non-greedy versions of ?, +, and *. These match as little as possible, unlike the greedy versions which match as much as possible. Example: given the input "<abc><def>", <.*?> matches "<abc>" while <.*> matches "<abc><def>".
|
\
|
Escape character: interpret the next character literally (for example, [0-9]+ matches one or more digits, but [0-9]\+ matches a digit followed by a plus character). Also used for abbreviations (such as \a for any alphanumeric character; see table below).
|
$
|
At the end of a regular expression, this character matches the end of the input. Example: [0-9]$ matches a digit at the end of the input.
|
|
|
Alternation operator: separates two expressions, exactly one of which matches (for example, T|the matches "The" or "the").
|
!
|
Negation operator: the expression following ! does not match the input. Example: a!b matches "a" not followed by "b".
|
Abbreviation
|
Matches
|
\a
|
Any alphanumeric character: ([a-zA-Z0-9])
|
\b
|
White space (blank): ([ \\t])
|
\c
|
Any alphabetic character: ([a-zA-Z])
|
\d
|
Any decimal digit: ([0-9])
|
\h
|
Any hexadecimal digit: ([0-9a-fA-F])
|
\n
|
Newline: (\r|(\r?\n))
|
\q
|
A quoted string: (\"[^\"]*\")|(\'[^\']*\')
|
\w
|
A simple word: ([a-zA-Z]+)
|
\z
|
An integer: ([0-9]+)
|
For example, the previous filter list could be entered as:
^.*?\.jpg$|^.*?\.jpeg$|^.*?\.gif$
Regular expressions are more trouble to define but some useful expressions could be done:
^[a-d].*?\.jpg$
Would only include (or exclude) files that start with a, b, c, or d and have the extension .jpg. Matches are always case insensitive.
There is a helpful tool to test your regular expressions - just click "Test filespec" from the modify action screen.

In the example above, we include files that start with letters within the range a-s and end with .jpg. We then exclude all files that have 12345 in them. The results are shown in the Files included/excluded panels.
|