code: public static String toLegacyKey(String keyword) {
          String legacyKey = KeyTypeData.toLegacyKey(keyword);
          if (legacyKey == null) {
              // Checks if the specified locale key is well-formed with the legacy locale syntax.
              //
              // Note:
              //  Neither ICU nor LDML/CLDR provides the definition of keyword syntax.
              //  However, a key should not contain '=' obviously. For now, all existing
              //  keys are using ASCII alphabetic letters only. We won't add any new key
              //  that is not compatible with the BCP 47 syntax. Therefore, we assume
              //  a valid key consist from [0-9a-zA-Z], no symbols.
              if (keyword.matches("[0-9a-zA-Z]+")) {
                  legacyKey = AsciiUtil.toLowerString(keyword);
              }
          }
          return legacyKey;
      }
docs: <strong>[icu]</strong> Converts the specified keyword (BCP 47 Unicode locale extension key, or
  legacy key) to the legacy key. For example, legacy key "collation" is
  returned for the input BCP 47 Unicode locale extension key "co".
  
  @param keyword       the input locale keyword (either BCP 47 Unicode locale
  extension key or legacy key).
  @return              the well-formed legacy key, or null if the specified
  keyword cannot be mapped to a well-formed legacy key.
  @see #toUnicodeLocaleKey(String)