you don't need to create a new regex object here.  `/\?|:|*|\\|/.test(filename)` works. You also don't need a set or to match on more than one.