public static Glob parse(String path) {
    var matcher = GLOB_PATTERN.matcher(path);
    if (!matcher.find()) {
      return of(Path.of(path));
    }
    matcher.reset();
    String base = matcher.replaceAll("");
    String separator = Path.of(base).getFileSystem().getSeparator();
    int idx = base.lastIndexOf(separator);
    if (idx > 0) {
      base = base.substring(0, idx);
    }
    return of(Path.of(base)).resolve(path.substring(idx + 1).split(Pattern.quote(separator)));
  }
Parse a string containing platform-specific file separators into a base+glob pattern.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/Glob.java