public static boolean sanitizeAndCheckValidTagName(@TagPattern final @NotNull String tagName) {
    return TAG_NAME_PATTERN.matcher(Objects.requireNonNull(tagName).toLowerCase(Locale.ROOT)).matches();
  }
Checks if a tag name matches the pattern for allowed tag names, first sanitizing it
by converting the tag name to lowercase. Returns a boolean representing the validity

@param tagName the name of the tag
@return validity of this tag when sanitized
@since 4.10.1
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/internal/TagInternals.java