basic-lib/src/main/java/com/streamsets/pipeline/stage/origin/remote/FileFilter.java
private static String globToRegex(String glob) {
    if (glob.charAt(0) == '.' || glob.contains("/") || glob.contains("~")) {
      throw new IllegalArgumentException("Invalid character in file glob");
    }

    // treat dot as a literal.
    glob = glob.replace(".", "\\.");
    glob = glob.replace("*", ".+");
    glob = glob.replace("?", ".{1}+");

    return glob;
  }
private static String globToRegex(String glob) {
    if (glob.charAt(0) == '.' || glob.contains("/") || glob.contains("~")) {
      throw new IllegalArgumentException("Invalid character in file glob");
    }

    // treat dot as a literal.
    glob = glob.replace(".", "\\.");
    glob = glob.replace("*", ".+");
    glob = glob.replace("?", ".{1}+");

    return glob;
  }
Convert a limited file glob into a simple regex.

@param glob file specification glob
@return regex.