This is an automated email from the ASF dual-hosted git repository.
paulk-asert pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 7f24df4 minor release note tweaks
7f24df4 is described below
commit 7f24df4b8ff5e4a4c3ed0e2770378c05475c8d64
Author: Paul King <[email protected]>
AuthorDate: Mon May 18 14:24:30 2026 +1000
minor release note tweaks
---
site/src/site/releasenotes/groovy-6.0.adoc | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/site/src/site/releasenotes/groovy-6.0.adoc
b/site/src/site/releasenotes/groovy-6.0.adoc
index 99ee649..5788a92 100644
--- a/site/src/site/releasenotes/groovy-6.0.adoc
+++ b/site/src/site/releasenotes/groovy-6.0.adoc
@@ -1484,6 +1484,29 @@ def b = Path.of('data.csv').textAsync
def (config, data) = await(a, b)
----
+=== Regex group extraction
+
+Capturing regex groups was always possible via `Matcher` (`m[0][1]` and
+friends), but the common case -- pull a few named pieces out of a string --
+meant juggling group indices and guarding against a non-match. `findGroups`
+returns the full match followed by each capture group as a `List`, so it
+pairs naturally with multi-assignment. This isn't new capability; it just
+removes the `Matcher` boilerplate from one very common case
+(https://issues.apache.org/jira/browse/GROOVY-11958[GROOVY-11958]):
+
+[source,groovy]
+----
+def semver = /(\d+)\.(\d+)\.(\d+)(?:-(.+))?/
+
+def (_, major, minor, patch, qualifier) = '6.0.0-beta-2'.findGroups(semver)
+assert [major, minor, patch, qualifier] == ['6', '0', '0', 'beta-2']
+
+// optional qualifier absent: multi-assignment pads with null,
+// so the same destructuring works whether or not it matched
+def (_all, ma, mi, pa, q) = '4.0.28'.findGroups(semver)
+assert [ma, mi, pa, q] == ['4', '0', '28', null]
+----
+
=== Other new extension methods
[cols="2,3,1", options="header"]
@@ -1533,13 +1556,6 @@ for Groovy-truth filtering. Rounds out the `-ing` family
alongside
| https://issues.apache.org/jira/browse/GROOVY-11596[GROOVY-11596],
https://issues.apache.org/jira/browse/GROOVY-11957[GROOVY-11957]
-| `findGroups(regex)` / `findGroups(pattern)`
-| Find the first occurrence of a regex within a `CharSequence` and return
-the full match followed by each capture group as a `List` (empty if no
-match). Multi-assignment pads missing elements with `null`, so the same
-destructuring works whether or not the regex matches.
-| https://issues.apache.org/jira/browse/GROOVY-11958[GROOVY-11958]
-
| `findAllGroups(regex)` / `findAllGroups(pattern)`
| Return a list of all matches of a regex within a `CharSequence`, with
each match represented by a `List` containing the full match followed by