Skip to content

Commit 709de5d

Browse files
committed
Show any named captures in results underneath numbered captures
1 parent 50ae261 commit 709de5d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

server.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,18 @@ function serveTest(query, response)
379379
html.push(result[capture] == null ? "<i>(null)</i>" : h(result[capture]));
380380
html.push("<br/>");
381381
}
382+
if (result.groups) {
383+
var captureNames = Object.keys(result.groups);
384+
for (var namedCapture = 0; namedCapture < captureNames.length; namedCapture++)
385+
{
386+
var key = captureNames[namedCapture];
387+
html.push("groups.");
388+
html.push(key);
389+
html.push(": ");
390+
html.push(result.groups[key] == null ? "<i>(null)</i>" : h(result.groups[key]));
391+
html.push("<br/>");
392+
}
393+
}
382394
html.push("</td>\n");
383395

384396
html.push('\t\t\t<td>');

0 commit comments

Comments
 (0)