public static void assertValidTagName(@TagPattern final @NotNull String tagName) {
    if (!TAG_NAME_PATTERN.matcher(Objects.requireNonNull(tagName)).matches()) {
      throw new IllegalArgumentException("Tag name must match pattern " + TAG_NAME_PATTERN.pattern() + ", was " + tagName);
    }
  }
Checks if a tag name matches the pattern for allowed tag names. If it does not, then
this method will throw an {@link IllegalArgumentException}

@param tagName the name of the tag
@since 4.10.0
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/internal/TagInternals.java