diff --git a/lib/index.js b/lib/index.js index 31ce7ff..bf2f8a3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -49,7 +49,7 @@ return tag } - return str.replace(/\[(\d+;)?(\d+)*m/g, function(match, b1, b2) { + return str.replace(/\[(\d{1,3};)?(\d{1,3})?m/g, function(match, b1, b2) { var i, code, res = '' if (b2 == '' || b2 == null) b2 = '0' for (i = 1; i < arguments.length - 2; i++) {