Skip to content

Main content

SemVer Prerelease Numeric Token Tool

Inspect one SemVer prerelease identifier; numeric identifiers cannot contain leading zeroes.

Loading tool…

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

  1. Enter token. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
tokenTokenRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
numericNumericRequired. Boolean.
leadingZeroLeading ZeroRequired. Boolean.
validIdentifierValid IdentifierRequired. Boolean.
json
{
  "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

  1. Calculation and input contract: development/semver-prerelease-numeric-token — tool.io

  2. Semantic Versioning 2.0.0 — Semantic Versioning

Similar or alternative tools