From 3258f71340e25a9a488429ad0465054bbc6f1c93 Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 21 Aug 2018 15:12:47 +0800 Subject: [PATCH] modify --- libs/line-message/commands/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/line-message/commands/index.js b/libs/line-message/commands/index.js index cd991c7..58e7340 100644 --- a/libs/line-message/commands/index.js +++ b/libs/line-message/commands/index.js @@ -73,8 +73,8 @@ 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 + let key = i.key.replace(/(\+|\[|\]|\*|\$|\^|\(|\))/g, '\\$1') + txt += (txt.length > 0 ? '|' : '') + key } regex = new RegExp(`^(${txt})$`) console.log(regex)