Globbing expression or regular expression can be used to select or exclude file names in the SFTPPlus configuration.
Globbing expressions provide a simple method for selecting values. It is not suitable for excluding based on a certain pattern.
When globbing expressions are used, the values are matched using case-insensitive matching.
Valid globbing wildcards characters:
To match a meta-character, please wrap it in brackets. For example, [?] matches the character ?.
To only match PDF files, use the following configuration:
source_filter: *.pdf
Regular expressions are case-sensitive by default, but you can configure the expression to perform case-insensitive matching.
To signal that matching is done using regular expressions, the configured expression needs to be marked as m/EXPRESSION/.
Enclosing the regular expressions inside the m/EXPRESSION/ marker will ensure that leading and trailing blank spaces are not ignored, and are clearly identified when a person reads the configuration.
To perform a case-insensitive matching, please enclose the regular expression inside the m/EXPRESSION/i marker. Please note the trailing i.
Regular expression syntax is implemented using the Python RE module, which is modeled after the Perl implementation.
You can test the expression online using the Python section of RegexPlanet.com (leave out the leading m/ and trailing / markers).
For example, to only match PDF files whose file names extensions are either .pdf or .PDF , use the following configuration:
source_filter: m/.*\.pDf/i
In the case that you want to transfer only PDF files whose file name extensions are strictly .pdf , use the following configuration:
source_filter: m/.*\.pdf/
To exclude all files with the .pdf extension you can use the leading e/ marker to negate the define expression. This avoids using the regex look-around zero-length assertion rules:
source_filter: e/.*\.pdf/