fixed regex catastrophic backtracking for nested parens

This commit is contained in:
MaxRobinsonTheGreat 2024-10-26 17:14:34 -05:00
parent a598d72986
commit 583c9f8851

View file

@ -14,7 +14,7 @@ export function getCommand(name) {
return commandMap[name];
}
const commandRegex = /!(\w+)(?:\(((?:[^)(]+|'[^']*'|"[^"]*")*)\))?/
const commandRegex = /!(\w+)(?:\(([\s\S]*)\))?/
const argRegex = /(?:"[^"]*"|'[^']*'|[^,])+/g;
export function containsCommand(message) {