A version string consists of one or more version parts, separated with dots.
Each version part is itself parsed as a sequence of four parts: <number-a><string-b><number-c><string-d>
. Each of the parts is optional. Numbers are integers base 10 (may be negative), strings are non-numeric ASCII characters.
A few examples of valid version parts:
-
0
(as in1.0
):<number-a>=0
-
5a
(as in1.5a
):<number-a>=5
,<string-b>=a
-
5pre4
(as in3.5pre4
):<number-a>=5
,<string-b>=pre
,<number-c>=4
-
*
(as in1.0.*
):<string-b>=*
A few special parsing rules are applied for backwards compatibility and readability:
- if the version part is a single asterisk, it is interpreted as an infinitely-large number:
1.5.0.*
is the same as1.5.0.(infinity)
- if string-b is a plus sign, number-a is incremented to be compatible with the Firefox 1.0.x version format:
1.0+
is the same as1.1pre
The rationale behind splitting a version part into a sequence of strings and numbers is that when comparing version parts, the numeric parts are compared as numbers, e.g. '1.0pre1' < '1.0pre10', while the strings are compared bytewise. See the next section for details on how versions are compared.
See maintenance policy for special rules that mark version as "beta" in the AMO queues.