code: public static String checkMetadataIdentifier(String s) {
      // Note that we avoid using regular expressions here, since we've not used it anywhere else
      // thus far in Flogger (avoid it make it more likely that Flogger can be transpiled for things
      // like GWT).
      if (s.isEmpty()) {
        throw new IllegalArgumentException("identifier must not be empty");
      }
      if (!isLetter(s.charAt(0))) {
        throw new IllegalArgumentException("identifier must start with an ASCII letter: " + s);
      }
      for (int n = 1; n < s.length(); n++) {
        char c = s.charAt(n);
        if (!isLetter(c) && (c < '0' || c > '9') && c != '_') {
          throw new IllegalArgumentException(
              "identifier must contain only ASCII letters, digits or underscore: " + s);
        }
      }
      return s;
    }
docs: Checks if the given string is a valid metadata identifier.