docs: public static Pattern convertToRegex(String excludeStr) {
          // make all "." safe decimles then convert ** to .* and /* to /.* to make it regex
          if (excludeStr.contains(".")) {
              // regex for "." is \. - but we are converting the string to a regex string so need to escape the escape slash...
              excludeStr = excludeStr.replace(".", "\\.");
          }
          //if we exclude a dir (eg /**/) we need to remove the closing slash so our regex is /.*
          if (excludeStr.endsWith("/")) {
              excludeStr = excludeStr.substring(0, excludeStr.length() - 1);
          }
          if (excludeStr.contains("**")) {
              excludeStr = excludeStr.replace("**", ".*");
          }
          if (excludeStr.contains("/*")) {
              excludeStr = excludeStr.replace("/*", "/.*");
          }
          //need to escape the file seperators correctly, as / is a regex keychar
          if (excludeStr.contains("/")) {
              excludeStr = excludeStr.replace("/", "\\/");
          }
          //at this point we should not have any **, if we do replace with * as all * should be prefixed with a .
          if (excludeStr.contains("**")) {
              excludeStr = excludeStr.replace("**", "*");
          }
          if (excludeStr.startsWith("*")) {
              excludeStr = "." + excludeStr;
          }
          if (excludeStr.contains("[")) {
              excludeStr = excludeStr.replace("[", "\\[");
          }
          if (excludeStr.contains("]")) {
              excludeStr = excludeStr.replace("]", "\\]");
          }
          if (excludeStr.contains("-")) {
              excludeStr = excludeStr.replace("-", "\\-");
          }
          return Pattern.compile(excludeStr);
  
      }