diff --git a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy index ea2d147b..ecc90b8e 100644 --- a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy +++ b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy @@ -87,7 +87,8 @@ String.metaClass.after = { * * e.g. "The IT Crowd (UK)" -> "The IT Crowd" */ -String.metaClass.replaceTrailingBraces = { replacement = "" -> replaceAll(/\s*[(]([^)]*)[)]$/, replacement) } +String.metaClass.replaceTrailingBraces = +String.metaClass.replaceTrailingBrackets = { replacement = "" -> replaceAll(/\s*[(]([^)]*)[)]$/, replacement) } /** diff --git a/website/naming.html b/website/naming.html index 3732d450..8be9f745 100644 --- a/website/naming.html +++ b/website/naming.html @@ -101,7 +101,7 @@ E:/Complete/{n} ({y}){'/Season '+s}/{s+'x'}{e.pad(2)} - {t}Rename and move files. The directory structure is completely up to you.

- {n.replaceTrailingBraces()} - {s+'x'}{e.pad(2)} - {t.replaceAll(/[!?.]+$/).replaceAll(/[`´]/, "'").lowerTrail().replacePart(', Part $1')}My personal favorite. Pretty much 1x01, but with lots of cleanup operations. + {n.replaceTrailingBrackets()} - {s+'x'}{e.pad(2)} - {t.replaceAll(/[!?.]+$/).replaceAll(/[`´]/, "'").lowerTrail().replacePart(', Part $1')}My personal favorite. Pretty much 1x01, but with lots of cleanup operations.

@@ -295,7 +295,7 @@ after(pattern)Get the substring after the given pattern or the original value.

- replaceTrailingBraces(replacement = "")Replace trailing parenthesis including any leading whitespace (e.g. "The IT Crowd (UK)" -> "The IT Crowd"). + replaceTrailingBrackets(replacement = "")Replace trailing parenthesis including any leading whitespace (e.g. "The IT Crowd (UK)" -> "The IT Crowd").

replacePart(replacement = "")Replace part identifier (e.g. "Today Is the Day (1)" -> "Today Is the Day, Part 1").