Skip to content

Commit

Permalink
handle regex special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
zacronos committed Jan 15, 2016
1 parent 82ca12f commit 8dd8345
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 8dd8345

Please sign in to comment.