Forum Discussion

graham-onpoint's avatar
graham-onpoint
New Contributor II
6 years ago

Using simple wildcards in a Filter Snap?

I have a pretty simple Pipeline that gets a directory listing from Box, filters those files according to their filename, then calls Pipeline Execute to fetch the contents of the matched files using this syntax:

$FileName.match(_FILE_NAME_MATCH)!=null

Here is the filter:

I have six files in this folder:

When I set FILE_NAME_MATCH to “test” I get the two matching files:

I get the same result when I set this variable to “test*”. However, I get zero results when I set it to “test*.csv”:

I checked the same regex in JavaScript and no, it’s not a valid search query (i.e. SnapLogic is behaving as expected)

Given that my sysadmins who will be setting up the parameters for these jobs don’t know regex, is there a way for me to use simple Windows File System wildcard searching in the Filter Snap?

They may want to scan for files like this…

output??report(*).xls?

…and not have to know the regex to get it.