Regex Attempt 5
This commit is contained in:
parent
a5b6dfbb85
commit
76c15e5916
@ -9,16 +9,11 @@ outfile = sys.argv[2]
|
||||
with open(infile) as f:
|
||||
file = f.read().split('\n')
|
||||
for i in range(len(file)):
|
||||
file[i] = re.sub('0.0.0.0$', '', 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])
|
||||
file[i] = re.sub('127.0.0.1$', '', 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()
|
||||
|
Loading…
Reference in New Issue
Block a user