From 176befcf8ca0b85a2e52e880d2db72ec54cb7cd9 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:12:22 +0200 Subject: [PATCH] Fix more than 9 regex groups --- public/scripts/extensions/regex/engine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/extensions/regex/engine.js b/public/scripts/extensions/regex/engine.js index 0c417afc1..3612de891 100644 --- a/public/scripts/extensions/regex/engine.js +++ b/public/scripts/extensions/regex/engine.js @@ -118,7 +118,7 @@ function runRegexScript(regexScript, rawString, { characterOverride } = {}) { newString = rawString.replace(findRegex, function(match) { const args = [...arguments]; const replaceString = regexScript.replaceString.replace(/{{match}}/gi, '$0'); - const replaceWithGroups = replaceString.replaceAll(/\$(\d)+/g, (_, num) => { + const replaceWithGroups = replaceString.replaceAll(/\$(\d+)/g, (_, num) => { // Get a full match or a capture group const match = args[Number(num)];