From 3f3c28057ff4836b3330cb8722d095d602abbb71 Mon Sep 17 00:00:00 2001 From: Kyle Gay Date: Wed, 5 Jul 2023 19:09:23 -0500 Subject: [PATCH] return all submatches in RegexMatch instead of the first --- pkg/stdlib/strings/regex.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/stdlib/strings/regex.go b/pkg/stdlib/strings/regex.go index 0919272d9..05e19c7e6 100644 --- a/pkg/stdlib/strings/regex.go +++ b/pkg/stdlib/strings/regex.go @@ -43,8 +43,8 @@ func RegexMatch(_ context.Context, args ...core.Value) (core.Value, error) { return res, nil } - for _, m := range matches[0] { - res.Push(values.NewString(m)) + for _, m := range matches { + res.Push(values.NewString(m[0])) } return res, nil