From 3f2f276823e6aecf42d7788457bb3b0ff150b054 Mon Sep 17 00:00:00 2001 From: Luke Parkinson Date: Wed, 3 Jan 2024 22:35:51 +0000 Subject: [PATCH] - add regex group names When using regex operation, if including named capture groups then output the name of the group in the 'List matches with capture groups' output format. --- src/core/operations/RegularExpression.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/operations/RegularExpression.mjs b/src/core/operations/RegularExpression.mjs index 1d8de9c4..fddac2a9 100644 --- a/src/core/operations/RegularExpression.mjs +++ b/src/core/operations/RegularExpression.mjs @@ -203,7 +203,7 @@ function regexList(input, regex, displayTotal, matches, captureGroups) { if (captureGroups) { for (let i = 1; i < match.length; i++) { if (matches) { - output += " Group " + i + ": "; + output += " Group " + i + " (" + regex.xregexp.captureNames[i - 1] + "): "; } output += match[i] + "\n"; }