mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-04 14:25:43 +02:00
fixed regex catastrophic backtracking for nested parens
This commit is contained in:
parent
a598d72986
commit
583c9f8851
1 changed files with 1 additions and 1 deletions
|
@ -14,7 +14,7 @@ export function getCommand(name) {
|
||||||
return commandMap[name];
|
return commandMap[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
const commandRegex = /!(\w+)(?:\(((?:[^)(]+|'[^']*'|"[^"]*")*)\))?/
|
const commandRegex = /!(\w+)(?:\(([\s\S]*)\))?/
|
||||||
const argRegex = /(?:"[^"]*"|'[^']*'|[^,])+/g;
|
const argRegex = /(?:"[^"]*"|'[^']*'|[^,])+/g;
|
||||||
|
|
||||||
export function containsCommand(message) {
|
export function containsCommand(message) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue