Regex Fixing

This commit is contained in:
Minoplhy 2021-08-12 16:57:11 +07:00
parent dae13439d9
commit 413105e5ef

View File

@ -14,6 +14,11 @@ with open(infile) as f:
file[i] = re.sub('^0 ', '', file[i])
file[i] = re.sub('^:: ', '', file[i])
file[i] = re.sub('^::1 ', '' ,file[i])
file[i] = re.sub('^127.0.0.1', '', file[i])
file[i] = re.sub('^0.0.0.0', '', file[i])
file[i] = re.sub('^0', '', file[i])
file[i] = re.sub('^::', '', file[i])
file[i] = re.sub('^::1', '' ,file[i])
with open(infile, 'w') as f1:
f1.writelines(["%s\n" % item for item in file])
f.close()