re正则匹配
re正则匹配IP地址
s = "local host 192.168.11.11"
res = re.findall(r'\d+.\d+.\d+.\d+',s)
结果是['192.168.11.11']
邮箱匹配:
import re
s = "asdft@163.com"
# ret = re.match(r'^([a-z.0-9]{1,26})@([a-z.0-9]{1,20})(.[a-z0-9]{1,8})$', s)
if re.match(r'[0-9a-zA-Z_]{0,19}@163.com',s):
print("ok")
http://blog.csdn.net/sxingming/article/details/52244728
http://blog.csdn.net/u012965373/article/details/51395599