From 8d99be95d86b7a8dc43586b5b96fc8e5389dda26 Mon Sep 17 00:00:00 2001 From: Kenneth Hsu Date: Fri, 14 May 2021 12:57:44 -0700 Subject: Make period in regex filters match newline characters. By default, the dot (.) element matches every character _except_ the newline character. This causes issues with files that have a newline character in the name. For example, they are excluded when restoring the containing directory. By specifying the RegexOptions.Singleline option, the dot (.) element will match every character, including the newline character. This fixes #4508. --- Duplicati/Library/Utility/FilterExpression.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Duplicati/Library') diff --git a/Duplicati/Library/Utility/FilterExpression.cs b/Duplicati/Library/Utility/FilterExpression.cs index fc4eb1745..60ca22588 100644 --- a/Duplicati/Library/Utility/FilterExpression.cs +++ b/Duplicati/Library/Utility/FilterExpression.cs @@ -81,14 +81,15 @@ namespace Duplicati.Library.Utility /// The multiple wildcard character (DOS style) /// private const char MULTIPLE_WILDCARD = '*'; - + /// /// The regular expression flags /// private static readonly RegexOptions REGEXP_OPTIONS = RegexOptions.Compiled | RegexOptions.ExplicitCapture | - (Utility.IsFSCaseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase); + (Utility.IsFSCaseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase) | + RegexOptions.Singleline; // Since we might need to get the regex for a particular filter group multiple times // (e.g., when combining multiple FilterExpressions together, which discards the existing FilterEntries and recreates them from the Filter representations), -- cgit v1.2.3