fix regex bug
This commit is contained in:
parent
54e0daf198
commit
76970da355
@ -73,6 +73,7 @@ const parseCMD = async (text = '', source = {}) => {
|
||||
let txt = ''
|
||||
console.log('obj ::: ', obj)
|
||||
for (let i of obj) {
|
||||
i.key = i.key.replace(/(\+|\[|\]|\*|\$|\^|\(|\))/g, '\\$1')
|
||||
txt += (txt.length > 0 ? '|' : '') + i.key
|
||||
}
|
||||
regex = new RegExp(`^(${txt})$`)
|
||||
|
Loading…
Reference in New Issue
Block a user