Start a new topic

Find filter syntax

I'm somewhat familiar with using the * as a wildcard in the Find/Source filter but, I'm curious if there are more advanced options. For example, I have a new transfer that has a collection of 20ish files and I need to exclude two files with a similar name. Is there an option to match files (URLs) that do not contain a certain string? 


Or, can a filter be setup to include files that contain one of a selection of strings? In Perl (or similar regex) this would be like /myfile_(abc|def|ghi).txt/ to match three different files.


Thanks!


REGEX patterns are supported, but not generally suggested due to the complexities it can create.  But to use a REGEX, remember your filtering on the entire field URL, not just a name...  You must prefix the pattern with REGEX: to crush knows its regex.


So:


REGEX:.*/test.txt


The slash is helping it know that its after the last / that we are filtering...


A better way would be to find items, then have two exclude tasks after the find to remove files matching the pattern.


--Ben

Ah, the Exclude task might be the best option for the current project as the files I need to avoid would be easy to handle with a wildcard.


Good to know the Regex options is there, too. I have another project coming up that is probably going to need it.


Thanks for the help!

Login to post a comment