Description
Split a language-tag-shaped string into language, up to three extlang-shaped parts, and a remainder.
Identifier validation can involve several distinct questions: whether text has the expected shape, whether a checksum is consistent, and whether an authority actually assigned the identifier. Formatting and field extraction address narrower questions. Each result must be read according to the particular property the tool checks.
Split a language-tag-shaped string into language, up to three extlang-shaped parts, and a remainder.
When to use this tool
Use BCP 47 Extlang Subtag Boundary when you need the particular shape, formatting, field, or checksum property as one explicit stage in an identifier workflow.
How to use the tool and how it works
- Enter tag. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read language, extlangs, remainder. Use the output convention below.
Require a two- or three-letter first part and later alphanumeric parts from one through eight characters. Consume up to three following three-letter parts as extlangs, then return language, extlangs, and remainder.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| tag | Tag | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| language | Language | Required. Text; maximum UTF-16 length 8192. |
| extlangs | Extlangs | Required. Array of Text; maximum UTF-16 length 8192.; maximum items 256. |
| remainder | Remainder | Required. Array of Text; maximum UTF-16 length 8192.; maximum items 256. |
{
"input": {
"tag": "zh-cmn-Hans-CN"
},
"output": {
"language": "zh",
"extlangs": [
"cmn"
],
"remainder": [
"Hans",
"CN"
]
}
} Limitations and assumptions
- This is a structural split without registry, preferred-value, permitted-prefix, or complete language-tag checks. Tokens resembling an extlang are classified by spelling rather than verified assignment.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Use a complete format and checksum validator when required, then consult the issuing registry or verification process for assignment and identity. Preserve meaningful leading zeros as text.
References
Similar or alternative tools
- BCP 47 Private Use Tail Token
Extract a private-use tail after the first x subtag under a limited language-tag shape rule.
- DOI Suffix Nonempty Boundary Check
Split token at its first slash.