Fix more than 9 regex groups
This commit is contained in:
parent
41b6169ea8
commit
176befcf8c
|
@ -118,7 +118,7 @@ function runRegexScript(regexScript, rawString, { characterOverride } = {}) {
|
||||||
newString = rawString.replace(findRegex, function(match) {
|
newString = rawString.replace(findRegex, function(match) {
|
||||||
const args = [...arguments];
|
const args = [...arguments];
|
||||||
const replaceString = regexScript.replaceString.replace(/{{match}}/gi, '$0');
|
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
|
// Get a full match or a capture group
|
||||||
const match = args[Number(num)];
|
const match = args[Number(num)];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue