import re def emaills(e): if (len(e) >= 5): if re.match("[a-zA-Z0-9]+\@[a-zA-Z0-9]+\.+[a-zA-Z]",e): return 'correct' return 'error' e = raw_input('please emaill:') print e a = emaills(e) print a
import re def emaills(e): if (len(e) >= 5): if re.match("[a-zA-Z0-9]+\@[a-zA-Z0-9]+\.+[a-zA-Z]",e): return 'correct' return 'error' e = raw_input('please emaill:') print e a = emaills(e) print a
转载于:https://www.cnblogs.com/Kermit-Li/p/5619652.html