Description
Split at its last + when present, rejecting a plus only at the first or last position; return base, suffix, and present, using an empty suffix when absent.
Media-type and MIME parameter text can include quoted strings, structured suffixes, charsets, language tags, and percent-encoded values. Splitting the syntax is separate from decoding its encoding or verifying a registered type. A local token parser may implement a deliberately limited character grammar.
Split at its last + when present, rejecting a plus only at the first or last position; return base, suffix, and present, using an empty suffix when absent.
When to use this tool
Use Media Type Structured Suffix Token when you need the stated media/MIME parameter split, quote decoding, or suffix extraction.
How to use the tool and how it works
- Enter subtype. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read base, suffix, present. Inspect present before interpreting the associated values.
Require a nonempty ASCII subtype token from the implemented character set. Split at its last + when present, rejecting a plus only at the first or last position; return base, suffix, and present, using an empty suffix when absent.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| subtype | Subtype | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| base | Base | Required. Text; maximum UTF-16 length 8192. |
| suffix | Suffix | Required. Text; maximum UTF-16 length 8192. |
| present | Whether an internal final-plus suffix was present. | Required. Boolean. |
{
"input": {
"subtype": "problem+json"
},
"output": {
"base": "problem",
"suffix": "json",
"present": true
}
} Limitations and assumptions
- Case is preserved and multiple internal plus signs are allowed. The suffix is not checked against an IANA registry and no top-level type, parameter, or full media-type grammar is parsed.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use a complete header parser and explicit charset/percent decoding for an entire media parameter. Consult the relevant registration and grammar when semantic validity matters.
References
Similar or alternative tools
- Parsing: Mime Quoted Parameter Unescape
Unescape one restricted ASCII MIME quoted-string parameter, honoring quoted-pair escapes and rejecting raw quotes, controls and line folding.
- Mime Parameter Language Separator
Split the charset/language/value fields of a supplied extended MIME parameter without percent decoding.