From e2a1955330acc155cd6e92580d9ec74f3d55f09b Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Mon, 21 Nov 2016 19:16:12 -0800 Subject: [PATCH] Revert "handle regex special characters" This reverts commit 8dd8345d1498b8c6a3c6d7f7f4ebc600cfd2195b. We shouldn't have changed the original behavior, which too many people are relying on at this point. It's also technically a breaking change, which we shouldn't have landed on a minor/patch version change. So in the interest of not breaking people's logs in production, reverting this. We can discuss in a new issue if we want to restore this patch for a `v3` release, but at the moment I'm personally leaningo towards *no*, for historical reasons (i.e. this is reminding me of Node.js trying to remove `sys` if anybody reading this remembers those days). See the discussion in #250 for more backlog. --- debug.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug.js b/debug.js index a5992a44..6e9f5213 100644 --- a/debug.js +++ b/debug.js @@ -144,7 +144,7 @@ function enable(namespaces) { for (var i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/[\\^$+?.()|[\]{}]/g, '\\$&').replace(/\*/g, '.*?'); + namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else {