Pattern getFilePattern(String name) {
    if (name == null || "".equals(name.trim())) {
      throw new IllegalArgumentException("Name must not be empty");
    }

    int extIdx = name.lastIndexOf('.');
    String ext = "";
    if (extIdx != -1) {
      ext = "\\Q" + name.substring(extIdx) + "\\E";
      name = name.substring(0, extIdx);
    }
    name = "\\Q" + name + "\\E" + "-\\d+-\\d+" + ext;
    return Pattern.compile(name);
  }
Extracted from ManagerLogWriter. MainWithChildrenRollingFileHandler is used for both rolling of
log files and stat archive files.
geode-core/src/main/java/org/apache/geode/internal/io/MainWithChildrenRollingFileHandler.java