Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

Name Filter Syntax

If a name filter is to be specified as a configuration value, this filter often refers to the name of a file to be processed. However, the same syntax is also used in other contexts (e.g., for filtering field contents). Such properties are identified by the name or name component FileFilter or Filter.

A filter expression can be composed of several scalar values to define different alternative name patterns. A vertical bar (pipe character)(|) is used as a delimiter between the patterns.

"FileFilter": "*.jpg|*.jpeg"

This example filters for file attachments that have the .jpg or .jpeg extension.

The following wildcard characters are allowed:

  • Asterisk (*): any number of characters

  • Question mark (?): a single character

  • Hash character (#): a single numeric character

A regular expression can be used instead of a wildcard expression. To indicate that it is a regular expression, embed the expression in / characters:

"FileFilter": "/^.*(jpg|jpeg)$/"

For regular expressions, you can list alternative values and separate them with delimiters. These alternative values can also be listed in combination with wildcard expressions. For the definition of negative filters, the filter expression can be enclosed in a NOT(...):

"FileFilter": "*|NOT(*.tif)|NOT(*.tiff)"

In this example, the filter basically includes all file names (*), but explicitly excludes file names ending in .tif or .tiff.

In the case of positive filters, the evaluation of the alternative patterns is linked with OR. For negative filters, on the other hand, the result of the entire filter expression is evaluated as false if one of the constituent negative filters is true. Within a negative filter, an OR-link is permissible. The above expression above can thus also be formulated as follows:

"FileFilter": "*|NOT(*.tif|*.tiff)"

Notice

All filters, both as wildcard expressions and as regular expressions, are case-insensitive, so there is no need to specify alternative case-sensitive patterns for the same expression during configuration.