diff --git a/Apps/AdvancedBlockingApp/App.cs b/Apps/AdvancedBlockingApp/App.cs index d4c53e6a..a0d140a1 100644 --- a/Apps/AdvancedBlockingApp/App.cs +++ b/Apps/AdvancedBlockingApp/App.cs @@ -1254,7 +1254,7 @@ namespace AdvancedBlocking if (regex.Regex.IsMatch(domain)) { //found pattern - matchingPattern = regex.ToString(); + matchingPattern = regex.Regex.ToString(); blockListUrls = regex.BlockListUrls; return true; } @@ -1320,7 +1320,7 @@ namespace AdvancedBlocking } //load regex list patterns from queue - Dictionary allRegexPatterns = new Dictionary(totalRegexPatterns); + Dictionary> allRegexPatterns = new Dictionary>(totalRegexPatterns); foreach (KeyValuePair> regexListQueue in regexListQueues) { @@ -1330,21 +1330,26 @@ namespace AdvancedBlocking { string regex = queue.Dequeue(); - if (!allRegexPatterns.TryGetValue(regex, out _)) - allRegexPatterns.Add(regex, null); + if (!allRegexPatterns.TryGetValue(regex, out List sourceListUrls)) + { + sourceListUrls = new List(2); + allRegexPatterns.Add(regex, sourceListUrls); + } + + sourceListUrls.Add(regexListQueue.Key); } } //load regex list zone List regexListZone = new List(totalRegexPatterns); - foreach (KeyValuePair regexPattern in allRegexPatterns) + foreach (KeyValuePair> regexPattern in allRegexPatterns) { try { Regex regex = new Regex(regexPattern.Key, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); - regexListZone.Add(new RegexItem(regex, null)); + regexListZone.Add(new RegexItem(regex, regexPattern.Value)); } catch (RegexParseException ex) {