Skip to content

Commit

Permalink
docs(versioning:regex): mention numeric capture group requirement (re…
Browse files Browse the repository at this point in the history
…novatebot#32777)

Co-authored-by: Rhys Arkins <[email protected]>
  • Loading branch information
2 people authored and ssams committed Dec 2, 2024
1 parent a63a6e5 commit 912fc69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/modules/versioning/regex/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Regular Expression Versioning is designed to be a flexible fallback versioning approach if Renovate's other versioning schemes don't do the job.

The `regex` scheme makes use of Regular Express capture groups.
The `regex` scheme makes use of Regular Expression capture groups.

The valid capture groups for `regex` versioning are:

- `major`, `minor`, and `patch`: at least one of these must be provided. When determining whether a package has updates, these values will be compared in the standard semantic versioning fashion. If any of these fields are omitted, they will be treated as if they were `0` -- in this way, you can describe versioning schemes with up to three incrementing values.
Expand All @@ -11,6 +12,9 @@ The valid capture groups for `regex` versioning are:

The compatibility concept was originally introduced for Docker versioning but sometimes package authors may use/misuse suffixes to mean compatibility in other versioning schemes.

**Important: all capture groups must contain only purely numeric values.**
Even if there is a string prefix which is identical in all available versions, it must not be part of the capture group. For example a `build` capture group containing `r4` cannot be evaluated as number; Renovate cannot compare the `build` in this case. The capture group must be `4` instead.

Here is an example of using `regex` versioning to correct behavior of the `guava` Maven package, which misuses suffixes as compatibility indicators:

```json
Expand Down

0 comments on commit 912fc69

Please sign in to comment.