Skip to content

Commit

Permalink
Merge pull request #250 from zacronos/master
Browse files Browse the repository at this point in the history
handle regex special characters
  • Loading branch information
TooTallNate authored Oct 22, 2016
2 parents a4e36a8 + 8dd8345 commit 0682a14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function enable(namespaces) {

for (var i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings
namespaces = split[i].replace(/\*/g, '.*?');
namespaces = split[i].replace(/[\\^$+?.()|[\]{}]/g, '\\$&').replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
Expand Down

0 comments on commit 0682a14

Please sign in to comment.