diff --git a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy index 4e3cc3fd..d1580d7d 100644 --- a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy +++ b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy @@ -50,7 +50,7 @@ String.metaClass.replaceAll = { String pattern -> replaceAll(pattern, "") } * * e.g. "Doctor Who" -> "Doctor_Who" */ -String.metaClass.space = { replacement -> replaceAll(/[:?._\s]+/, replacement) } +String.metaClass.space = { replacement -> replaceAll(/[:?._]/, " ").trim().replaceAll(/\s+/, replacement) } /**