diff --git a/lib/rules/add.js b/lib/rules/add.js index d2e18276..14eb24ee 100644 --- a/lib/rules/add.js +++ b/lib/rules/add.js @@ -82,8 +82,12 @@ function add(rules, which, rule) { return rule.replace(reEscapeChars, '\\$&') .replace(reAsterisk, '.*'); }).join('|'); + + //Only match if a '\', '/' or nothing comes before item + //Additionally only match if a '\', '/' or nothing comes after the item + re = '(\\/|\\\\|^)('+re+')($|\\/|\\\\)'; // used for the directory matching rules[which].re = new RegExp(re); } -} \ No newline at end of file +}