From d1f12dd6280caae0c31d5b6e9d01973766c17b72 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 9 Jul 2009 20:02:44 +0000 Subject: [PATCH] * more general "Part n" pattern --- .../sourceforge/filebot/format/ExpressionFormat.global.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/net/sourceforge/filebot/format/ExpressionFormat.global.js b/source/net/sourceforge/filebot/format/ExpressionFormat.global.js index 901d2cb2..ea9db9d7 100644 --- a/source/net/sourceforge/filebot/format/ExpressionFormat.global.js +++ b/source/net/sourceforge/filebot/format/ExpressionFormat.global.js @@ -43,7 +43,7 @@ String.prototype.replaceTrailingBraces = function(replacement) { // use empty string as default replacement var r = replacement ? replacement : ""; - return this.replace(/\s*\(([^\)]*)\)$/, r); + return this.replace(/\s*[(]([^)]*)[)]$/, r); } @@ -57,9 +57,8 @@ String.prototype.replacePart = function (replacement) { // use empty string as default replacement var r = replacement ? replacement : ""; - // handle '(n)' and ': Part n' syntax - var pattern = [/\s*\((\w+)\)$/i, /\s*\W? Part (\w+)$/i]; - + // handle '(n)', '(Part n)' and ': Part n' like syntax + var pattern = [/\s*[(](\w+)[)]$/i, /\W*Part (\w+)\W*$/i]; for (var i = 0; i < pattern.length; i++) { if (pattern[i].test(this)) { return this.replace(pattern[i], r);