Description
Inspect prerelease identifier syntax and numeric leading zeros.
Semantic versions separate core numbers, prerelease identifiers and build metadata. Numeric prerelease leading zeros are restricted while build identifiers preserve text; local identifier or bound checks do not implement complete dependency-range resolution.
Inspect prerelease identifier syntax and numeric leading zeros.
When to use this tool
Use SemVer Prerelease Numeric Token when checking one explicit version-token or core-bound convention.
How to use the tool and how it works
- Enter token. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read numeric, leadingZero, validIdentifier. Inspect numeric, leadingZero, validIdentifier before interpreting the associated values.
Inspect prerelease identifier syntax and numeric leading zeros. Return numeric for ASCII digits only, leadingZero for multi-digit numeric tokens beginning zero, and validIdentifier for nonempty ASCII alphanumeric/hyphen without that violation.1
Numeric prerelease identifiers exclude leading zeros; build metadata identifiers can retain them and do not affect version precedence.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Token | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| numeric | Numeric | Required. Boolean. |
| leadingZero | Leading Zero | Required. Boolean. |
| validIdentifier | Valid Identifier | Required. Boolean. |
{
"input": {
"token": "01"
},
"output": {
"numeric": true,
"leadingZero": true,
"validIdentifier": false
}
} Limitations and assumptions
- Invalid syntax returns flags rather than a parse error; a whole version is not 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 conforming full version/range implementation and package-manager resolution when compatibility or installation is the question.
References
-
Calculation and input contract: development/semver-prerelease-numeric-token — tool.io
-
Semantic Versioning 2.0.0 — Semantic Versioning
Similar or alternative tools
- SemVer Prerelease Leading Zero Flag
Flag numeric leading-zero violations in one prerelease identifier.
- Development: SemVer Prerelease Identifier Kind
Classify one valid prerelease identifier as numeric or alphanumeric.