From 5695b9b84f9d88604b10802776bde469de91b439 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 29 Jan 2013 05:32:00 +0000 Subject: [PATCH] * enable multi-line regex mode for match() --- .../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 b528c262..fe45f156 100644 --- a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy +++ b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy @@ -44,7 +44,7 @@ String.metaClass.pad = Number.metaClass.pad = { length = 2, padding = "0" -> del * Return a substring matching the given pattern or break. */ String.metaClass.match = { String pattern, matchGroup = null -> - def matcher = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE).matcher(delegate) + def matcher = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.MULTILINE).matcher(delegate) if (matcher.find()) return matcher.groupCount() > 0 && matchGroup == null ? matcher.group(1) : matcher.group(matchGroup ?: 0) else