# -*- coding: utf-8 -*-
import sys,os,re
filedir="/tmp/checkemail"
file=filedir+"/email_list"
errfile=filedir+"/error_email"
def checkemail():
f=open(file,'r')
lines=f.readlines()
for line in lines:
line1=line[:-1]
p=re.compile(r'^[_a-z0-9-]+(\.[a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$')
a=p.match(line)
if a==None:
err=open("errfile",'a')
err.write(line)
else:
pass
if __name__ == '__main__':
checkemail()
|