From f8b0eaea952c4e7a4a0ead8a327219af6e00985f Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 29 Jun 2012 09:03:23 +0000 Subject: [PATCH] handle contractions (e.g. should not capitalize to Don'T but Don't) --- .../net/sourceforge/filebot/format/ExpressionFormat.lib.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy index 89a0eceb..7e1c7c37 100644 --- a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy +++ b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy @@ -61,7 +61,7 @@ String.metaClass.space = { replacement -> replaceAll(/[:?._]/, " ").trim().repla * * e.g. "The Day a new Demon was born" -> "The Day A New Demon Was Born" */ -String.metaClass.upperInitial = { replaceAll(/\b[a-z]/, { it.toUpperCase() }) } +String.metaClass.upperInitial = { replaceAll(/(?<=[&()+.,-;<=>?\[\]_{|}~ ]|^)[a-z]/, { it.toUpperCase() }) } /**