diff --git a/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py b/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py index 52a9ce13e..f1370e123 100644 --- a/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py +++ b/NorwegianExperimentalList alternate versions/XYZPrepareFilters.py @@ -851,11 +851,17 @@ def prepare_ag(lines) -> str: # until this is done: https://github.com/AdguardTeam/CoreLibs/issues/152 line = re.sub( - r"[$,]doc.*", + "\$doc", "$empty,important", line ) + line = re.sub( + ",doc", + ",empty,important", + line + ) + line = re.sub( "Dandelion Sprout's Anti-Malware List", "Dandelion Sprout's Anti-Malware List (for AdGuard)", @@ -886,12 +892,6 @@ def prepare_ag(lines) -> str: line ) - line = re.sub( - r"[$,]domain$", - "", - line - ) - line = re.sub( r"\|~ Warning.*", "", @@ -910,6 +910,12 @@ def prepare_ag(lines) -> str: line ) + line = re.sub( + r"([$,])domain$", + "", + line + ) + text += line + '\r\n' return text @@ -928,9 +934,14 @@ def prepare_abp(lines) -> str: # remove or modifiy entries with unsupported modifiers for line in lines: - # remove $document modifier from the rule line = re.sub( - r"[$,]doc.*", + "\$doc", + "", + line + ) + + line = re.sub( + ",doc", "", line ) @@ -984,12 +995,6 @@ def prepare_abp(lines) -> str: line ) - line = re.sub( - r"[$,]domain$", - "", - line - ) - line = re.sub( r"\|~ Warning.*", "", @@ -1009,7 +1014,13 @@ def prepare_abp(lines) -> str: ) line = re.sub( - r"\$doc.*", + "\^,", + "^$", + line + ) + + line = re.sub( + r"([$,])domain$", "", line )