Version String Parser
StrictSemVer2three-numericcomponents/prerelease/buildparser,no coercion/comparison or arbitraryvendorversionmeaning. Explicitboundedofflineconvention,not authoritative external identity,eligibility,clinical or safe-use determination.
Description
Semantic Versioning separates a release into major, minor and patch numbers with optional prerelease and build identifiers.
When to use Version String Parser
Use this tool to apply the stated version string parser operation with an explicit input and unit basis.
How to use Version String Parser and how it works
- Establish the text or game convention described above.
- Enter actualVersionText and run the tool.
- Read result.major, result.minor, result.patch, result.prerelease, result.build using the output meanings below.
- If input is rejected, correct the stated type, range, ordering or alignment issue and rerun; review successful results under the declared convention.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| actualVersionText | Version Text. Units, ordering and applicable branch are specified in the algorithm. | string | required; further conditions in the algorithm |
Match the canonical SemVer 2.0.0 three-number syntax with no leading zeros in core numbers or purely numeric prerelease identifiers. Require core components to fit JavaScript safe integers; return absent prerelease and build metadata as empty strings. Build numeric identifiers may have leading zeros.
version = major.minor.patch[-prerelease][+build] Apply the declared units, ordering and branch conditions.
| Output field | Meaning | Value type |
|---|---|---|
| result | Object containing the declared output fields. | object |
| result.major | Major version component as a nonnegative safe integer. | number |
| result.minor | Minor version component as a nonnegative safe integer. | number |
| result.patch | Patch version component as a nonnegative safe integer. | number |
| result.prerelease | Prerelease identifier text, or an empty string if absent. | string |
| result.build | Build metadata text, or an empty string if absent. | string |
{
"input": {
"actualVersionText": "1.2.3-alpha.1+build.7"
},
"output": {
"result": {
"major": 1,
"minor": 2,
"patch": 3,
"prerelease": "alpha.1",
"build": "build.7"
}
}
} Limitations and assumptions
The output applies the declared operation to the values you supply. Establish the measurement basis, units, coefficients and any caller-selected rules before interpreting it. The tool does not independently collect or verify observations or decide whether a model or reference applies.
Supply explicit required fields with the documented types and dense aligned arrays. Unknown fields, wrong types and nonfinite numbers are rejected. Branch-specific constraints are explained above. A returned boolean, signed difference or tied result follows the stated convention; an input error instead means the required input contract was not satisfied. Very large inputs or outputs may be rejected by shared resource limits.
The SemVer specification defines core numbers, prerelease identifiers and build metadata. This parser enforces that syntax and adds a safe-integer limit for the three numeric components.
Alternative or Complementary methods
References
-
Version String Parser — tool.io
-
Semantic Versioning 2.0.0 — Semantic Versioning
-
Semantic Version Comparator — committed implementation — tool.io
-
Semantic Version Range Checker — committed implementation — tool.io
Similar or alternative tools
- Semantic Version Comparator
Compare two supplied versions by precedence; build metadata is ignored.
- Semantic Version Range Checker
Check a version against the supported conjunction of range comparators.