How it works
How does SemanVer work?
Last updated
How does SemanVer work?
Last updated
When SemVer.Parse()
gets called with a semantic version string, it first checks the string against the SemVer compliance using the following regular expression (fetched from ). If it doesn't find any version element, such as the case of 1.0-1
, it returns an error.
This is the regular expression used:
If there's a match, the next step is to extract the following information:
Major version (MajorVersion
, int
)
Minor version (MinorVersion
, int
)
Patch version (PatchVersion
, int
)
Pre-Release info (PreReleaseInfo
, string
)
Build metadata (BuildMetadata
, string
)
Finally, the parser creates a new class instance which holds all the parsed information.