Enum SemVersionRangeOptions
Determines the parsing options and allowed styles of range and version strings passed to the Parse(String, SemVersionRangeOptions, Int32) and TryParse(String, SemVersionRangeOptions, out SemVersionRange, Int32) methods. These styles only affect which strings are accepted when parsing. The constructed ranges and version numbers are valid semantic version ranges without any of the optional features in the original string.
Most options only allow additional version styles. However, the IncludeAllPrerelease option modifies how version ranges are interpreted. With this option, all prerelease versions within the range bounds will be considered to be in the range. Without this option, only prerelease versions where one comparison with the same major, minor, and patch versions is prerelease will satisfy the range. For more information, see the range expressions documentation.
This enumeration supports a bitwise combination of its member values (e.g.
SemVersionRangeOptions.OptionalPatch | SemVersionRangeOptions.AllowV
).
Namespace: Semver
Assembly: Semver.dll
Syntax
[Flags]
public enum SemVersionRangeOptions
Fields
Name | Description |
---|---|
AllowLeadingZeros |
Allow leading zeros on major, minor, patch, and prerelease version numbers. Leading zeros will be removed from the constructed version number. |
AllowLowerV | Allow a leading lowercase "v" on versions. |
AllowMetadata | Allow version numbers with build metadata in version range expressions. The metadata will be removed/ignored for the definition of the version range. |
AllowUpperV | Allow a leading uppercase "V" on versions. |
AllowV | Allow a leading "v" or "V" on versions. |
IncludeAllPrerelease | Include all prerelease versions in the range rather than just prerelease versions matching a prerelease identifier in the range. |
Loose |
Accept any version string format supported. The formats accepted by this style will change if/when more formats are supported. |
OptionalMinorPatch | Minor and patch version numbers are optional on versions. |
OptionalPatch | Patch version number is optional on versions. |
Strict | Accept versions strictly conforming to the SemVer 2.0 spec without metadata. |