diff --git a/lib/cli-table/utils.js b/lib/cli-table/utils.js
index <HASH>..<HASH> 100644
--- a/lib/cli-table/utils.js
+++ b/lib/cli-table/utils.js
@@ -77,7 +77,7 @@ exports.options = options;
 // see: http://en.wikipedia.org/wiki/ANSI_escape_code
 //
 exports.strlen = function(str){
-  var code = /\u001b\[(?:\d*;){0,2}\d*m/g;
+  var code = /\u001b\[(?:\d*;){0,5}\d*m/g;
   var stripped = ("" + str).replace(code,'');
   var split = stripped.split("\n");
   return split.reduce(function (memo, s) { return (s.length > memo) ? s.length : memo }, 0);
In addition to <I>-xterm ansi colors, handle <I>-bit colors. E.g., of the form ESC[ … <I>;2;<r>;<g>;<b>. Slight tweak in regex.