0

I am trying to write a GLOB pattern to exclude a partially downloaded file to be read by the File Listener. I am using the file name pattern foo.*[^filepart] in the File matcher but it doesn't works.

Please suggest.

<file:matcher name="filename-regex-filter" doc:name="Matcher" doc:id="410af88e-b6c6-4816-aaff-1f4edc29214f" filenamePattern="foo.*[^filepart]" />
SkyC
  • 3
  • 4

1 Answers1

0

filenamePattern is a regular expression. In regular expressions the pattern [^abc] excludes any of the set of characters after ^.

For example abc[^def] matches abcd, abce and abcf, but it doesn't match abcdef.

The answer is in previous questions about how to exclude words in regular expressions: https://stackoverflow.com/a/1333787/721855 or https://stackoverflow.com/a/2078953/721855. Use the (?!X) expression instead.

Example: foo.*(?!filepart)

aled
  • 21,330
  • 3
  • 27
  • 34
  • Thanks. I found out the we can use regex instead of GLOB, we just have to append "regex:" at the beginning of the expression. – SkyC Jun 08 '21 at 14:28