isValidMimeTypeName

Check if name is valid MIME type name.

@nogc @safe nothrow pure
bool
isValidMimeTypeName
(
scope const(char)[] name
)

Examples

assert( isValidMimeTypeName("text/plain"));
assert( isValidMimeTypeName("text/plain2"));
assert( isValidMimeTypeName("text/vnd.type"));
assert( isValidMimeTypeName("x-scheme-handler/http"));
assert(!isValidMimeTypeName("not mime type"));
assert(!isValidMimeTypeName("not()/valid"));
assert(!isValidMimeTypeName("not/valid{}"));
assert(!isValidMimeTypeName("text/"));
assert(!isValidMimeTypeName("/plain"));
assert(!isValidMimeTypeName("/"));

Meta