Permalink
Browse files

[minor] An even better regexp for removing `CSI Pm m`.

  • Loading branch information...
1 parent c25f3d1 commit 7169dd284b44c582b68f7cbfa3d29fe6e5572f82 @chjj chjj committed Jun 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/winston/logger.js
View
@@ -172,7 +172,7 @@ Logger.prototype.log = function (level, msg) {
// see: http://en.wikipedia.org/wiki/ANSI_escape_code
//
if (this.stripColors) {
- var code = /\u001b\[\d+(?:;\d+)*m/g;
+ var code = /\u001b\[(\d+(;\d+)*)?m/g;
msg = ('' + msg).replace(code, '');
}

0 comments on commit 7169dd2

Please sign in to comment.