private void appendInBracket(char c) {
    // escape \ in regex character class
    if (c == '\\') {
      builder.append('\\');
    }

    builder.append(c);
  }
Appends the regex form of the given character within a glob [] section.
jimfs/src/main/java/com/google/common/jimfs/GlobToRegex.java