Commit 8e6ba71b3a6680c80d8cbbe97f039ad27ec5da4b
1 parent
441c4cc13b
Exists in
master
rc-from-msg support flags
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
rc-from-msg.js
... | ... | @@ -9,7 +9,7 @@ function run(msg, rules) { |
9 | 9 | for(let i = 0; i < rules_count; i++) { |
10 | 10 | const rule = rules[i]; |
11 | 11 | |
12 | - const re = new RegExp(rule.pattern); | |
12 | + const re = (typeof rule.flags === 'string') ? new RegExp(rule.pattern, rule.flags) : new RegExp(rule.pattern); | |
13 | 13 | if (msg.search(re) > 0) { |
14 | 14 | return rule.rc || rule.result; |
15 | 15 | } |