Skip to main content

Module parse

Module parse 

Source
Expand description

Loose semver parsing helpers.

Strict SemVer 2.0.0 does not allow a leading v (or similar). In practice many tools publish tags like v1.2.3, v.1.2.3, or v:1.2.3. Loose mode strips a single leading prefix of that form before parsing.

Functionsยง

normalize_loose_range
Normalize a version requirement for loose parsing by stripping v/V (optionally followed by ., :, -, or _) before version numbers at comparator boundaries.
parse_version
Parse a version string, optionally accepting a loose leading prefix.
parse_version_req
Parse a version requirement string, optionally accepting loose version prefixes.
strip_loose_version_prefix
Strip a loose leading version prefix: v/V, optionally followed by ., :, -, or _, only when the remainder starts with a digit.