From bf969502e980891d771eb1e487a3c5e100378b97 Mon Sep 17 00:00:00 2001 From: Minoplhy Date: Wed, 15 Dec 2021 15:29:54 +0700 Subject: [PATCH] AdGuard: Add more Regex --- to-rpz/adguard-host-wildcards_rpz_argv.py | 2 +- to-rpz/adguard-host_rpz_argv.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/to-rpz/adguard-host-wildcards_rpz_argv.py b/to-rpz/adguard-host-wildcards_rpz_argv.py index 10639e7..9fd2b11 100644 --- a/to-rpz/adguard-host-wildcards_rpz_argv.py +++ b/to-rpz/adguard-host-wildcards_rpz_argv.py @@ -9,7 +9,7 @@ outfile = sys.argv[2] with open(infile) as f: file = f.read().split('\n') for i in range(len(file)): - file[i] = sub('(@@\|\|..*)|(\|\|..*\/..*)|(^\|http)|(^(_|\*|&|\-|\/|\.|:|@@|\?|\=|\;|\,)..*)|(..*(#|\$)..*)|(^..*\$(app=|removeparam=)..*)|(\|\|..*\/..*)', '', file[i]) + file[i] = sub('(@@\|\|..*)|(\|\|..*(\/|\*(\-|\&|banner|..))..*)|(^\|http)|(^(_|\*|&|\-|\/|\.|:|@@|\?|\=|\;|\,|\$)..*)|(..*(#|\$|\*)..*)|(^..*\$(app=|removeparam=|popup)..*)(\$..*)', '', file[i]) #print(file) with open(infile, 'w') as f1: f1.writelines(["%s\n" % item for item in file]) diff --git a/to-rpz/adguard-host_rpz_argv.py b/to-rpz/adguard-host_rpz_argv.py index ee943c0..bdf79fd 100644 --- a/to-rpz/adguard-host_rpz_argv.py +++ b/to-rpz/adguard-host_rpz_argv.py @@ -9,7 +9,7 @@ outfile = sys.argv[2] with open(infile) as f: file = f.read().split('\n') for i in range(len(file)): - file[i] = re.sub('(@@\|\|..*)|(\|\|..*\/..*)|(^\|http)|(^(_|\*|&|\-|\/|\.|:|@@|\?|\=|\;|\,)..*)|(..*(#|\$)..*)|(^..*\$(app=|removeparam=)..*)|(\|\|..*\/..*)', '', file[i]) + file[i] = re.sub('(@@\|\|..*)|(\|\|..*(\/|\*(\-|\&|banner|..))..*)|(^\|http)|(^(_|\*|&|\-|\/|\.|:|@@|\?|\=|\;|\,|\$)..*)|(..*(#|\$|\*)..*)|(^..*\$(app=|removeparam=|popup)..*)(\$..*)', '', file[i]) #print(file) with open(infile, 'w') as f1: f1.writelines(["%s\n" % item for item in file])