AdGuard, AdGuard Wildcard : Support '~' Regex

This commit is contained in:
Minoplhy 2022-01-15 15:17:32 +07:00
parent a8eed6cded
commit cc594b2024
Signed by: minoplhy
GPG Key ID: 90667A59A9908AEC
2 changed files with 2 additions and 2 deletions

View File

@ -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('((\|\||\@\@\|\|)..*(\/|\*(\-|\&|banner|..))..*)|(^\|http)|(^(_|\*|&|\-|\/|\.|:|\?|\=|\;|\,|\$)..*)|(..*(#|\$|\*)..*)|(^..*\$(app=|removeparam=|popup)..*)(\$..*)', '', 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])

View File

@ -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('((\|\||\@\@\|\|)..*(\/|\*(\-|\&|banner|..))..*)|(^\|http)|(^(_|\*|&|\-|\/|\.|:|\?|\=|\;|\,|\$)..*)|(..*(#|\$|\*)..*)|(^..*\$(app=|removeparam=|popup)..*)(\$..*)', '', 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])